Loading...
Loading...
Fix Python code formatting issues using the Ruff formatter. Use when: (1) Formatting errors are detected by ruff format --check, (2) Python files need to be formatted to match project style, (3) Pre-commit hooks or CI fail due to formatting issues.
npx skill4agent add frizzle-chan/mudd ruff-formatter# Format all files in current directory
ruff format .
# Format specific file(s)
ruff format path/to/file.py
# Check without modifying (CI/pre-commit)
ruff format --check .
# Show diff of what would change
ruff format --diff .ruff format --checkruff format .git diffruff check --select I --fix . # Sort imports
ruff format . # Then format# fmt: off
matrix = [
[1, 0, 0],
[0, 1, 0],
[0, 0, 1],
]
# fmt: on
x = 1 # fmt: skippyproject.tomlruff.toml[tool.ruff.format]
quote-style = "double" # or "single"
indent-style = "space" # or "tab"
line-length = 88 # default
docstring-code-format = true--check