Rattle is a Python linting framework built on LibCST with support for autofixes, custom in-repo lint rules, and hierarchical configuration.
Rattle is a fork of Fixit.
- Built-in lint rules for common Python issues
- Autofix support when a rule can safely rewrite code
- Local custom rules that can live inside your repository
- Hierarchical
pyproject.tomlconfiguration - Pre-commit integration for CI and local workflows
- LSP support
Install the CLI from PyPI:
pip install rattle-lintInstall editor/LSP support too:
pip install "rattle-lint[lsp]"rattle lintApply available autofixes:
rattle fix[tool.rattle]
root = true
python-version = "3.10"
output-format = "rattle"
disable = [
"NoStaticIfCondition",
"UseAssertIn",
]
per-file-disable = {"tests/generated.py" = ["UseFstring"]}
[tool.rattle.options.UseFstring]
simple_expression_max_length = 40
[[tool.rattle.overrides]]
path = "tests"
enable = ["UseAssertIn"]
options = { UseFstring = { simple_expression_max_length = 60 } }MIT