Metadata-Version: 2.4
Name: rattle-lint
Version: 1.0.6
Summary: A framework for custom Python linters with auto-fixes and hierarchical configuration
Project-URL: Home, https://github.com/zigai/rattle
Project-URL: Issues, https://github.com/zigai/rattle/issues
Author: zigai
License-Expression: MIT
License-File: LICENSE
License-File: NOTICE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.10
Requires-Dist: click<9,>=8.0
Requires-Dist: libcst>=0.3.18
Requires-Dist: moreorless>=0.4.0
Requires-Dist: packaging>=21
Requires-Dist: tomli>=2.0; python_version < '3.11'
Requires-Dist: trailrunner>=1.2
Provides-Extra: dev
Requires-Dist: attribution==1.8.0; extra == 'dev'
Requires-Dist: black==25.11.0; extra == 'dev'
Requires-Dist: build>1; extra == 'dev'
Requires-Dist: codespell>=2.4.2; extra == 'dev'
Requires-Dist: coverage>=7.13.5; extra == 'dev'
Requires-Dist: pre-commit>=4.5.1; extra == 'dev'
Requires-Dist: pyright; extra == 'dev'
Requires-Dist: pytest>=9.0.2; extra == 'dev'
Requires-Dist: ruff==0.15.8; extra == 'dev'
Requires-Dist: tomli; extra == 'dev'
Requires-Dist: ufmt==2.8.0; extra == 'dev'
Requires-Dist: usort==1.0.8.post1; extra == 'dev'
Provides-Extra: docs
Requires-Dist: jinja2==3.1.6; extra == 'docs'
Requires-Dist: myst-parser==4.0.1; extra == 'docs'
Requires-Dist: sphinx==8.0.2; extra == 'docs'
Provides-Extra: lsp
Requires-Dist: pygls[ws]~=2.0.0; extra == 'lsp'
Provides-Extra: pretty
Requires-Dist: rich>=12.6.0; extra == 'pretty'
Description-Content-Type: text/markdown

# Rattle

[![Tests](https://github.com/zigai/rattle/actions/workflows/tests.yml/badge.svg)](https://github.com/zigai/rattle/actions/workflows/tests.yml)
[![PyPI version](https://badge.fury.io/py/rattle-lint.svg)](https://badge.fury.io/py/rattle-lint)
![Supported versions](https://img.shields.io/badge/python-3.10+-blue.svg)
[![Downloads](https://static.pepy.tech/badge/rattle-lint)](https://pepy.tech/project/rattle-lint)
[![license](https://img.shields.io/github/license/zigai/rattle.svg)](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
