https://github.com/zigai/rattle
A framework for custom Python linters with auto-fixes and hierarchical configuration
https://github.com/zigai/rattle
linter python python3 rattle static-analysis static-code-analysis
Last synced: 15 days ago
JSON representation
A framework for custom Python linters with auto-fixes and hierarchical configuration
- Host: GitHub
- URL: https://github.com/zigai/rattle
- Owner: zigai
- License: mit
- Created: 2026-03-24T20:28:32.000Z (25 days ago)
- Default Branch: main
- Last Pushed: 2026-03-28T08:46:14.000Z (22 days ago)
- Last Synced: 2026-03-28T12:47:57.203Z (22 days ago)
- Topics: linter, python, python3, rattle, static-analysis, static-code-analysis
- Language: Python
- Homepage:
- Size: 509 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Notice: NOTICE
Awesome Lists containing this project
README
# Rattle
[](https://github.com/zigai/rattle/actions/workflows/tests.yml)
[](https://badge.fury.io/py/rattle-lint)

[](https://pepy.tech/project/rattle-lint)
[](https://github.com/zigai/rattle/blob/main/LICENSE)
Rattle is a Python linting framework built on [LibCST](https://libcst.readthedocs.io) with support for autofixes, custom in-repo lint rules, and hierarchical configuration.
Rattle is a fork of [Fixit](https://github.com/Instagram/Fixit).
## Features
- 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.toml` configuration
- Pre-commit integration for CI and local workflows
- LSP support
## Install
Install the CLI from PyPI:
```bash
pip install rattle-lint
```
Install editor/LSP support too:
```bash
pip install "rattle-lint[lsp]"
```
## Basic Usage
```bash
rattle lint
```
Apply available autofixes:
```bash
rattle fix
```
## Example Configuration
```toml
[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 } }
```
## License
MIT