Skip to main content

A lint framework that helps you write better Python code.

Project description

Rattle

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.

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:

pip install rattle-lint

Install editor/LSP support too:

pip install "rattle-lint[lsp]"

Basic Usage

rattle lint

Apply available autofixes:

rattle fix

Example Configuration

[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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rattle_lint-1.0.1.tar.gz (171.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rattle_lint-1.0.1-py3-none-any.whl (105.7 kB view details)

Uploaded Python 3

File details

Details for the file rattle_lint-1.0.1.tar.gz.

File metadata

  • Download URL: rattle_lint-1.0.1.tar.gz
  • Upload date:
  • Size: 171.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for rattle_lint-1.0.1.tar.gz
Algorithm Hash digest
SHA256 0242d0fec7fa041407fc79cfff0602f62dd30d3d770e7018160fba427a7a3417
MD5 f329cc0eeaa97621d0322a7ced953b31
BLAKE2b-256 e028bc47f0bd14776b27f72c01ba478115649bd5a741292c879fa4a611db59ca

See more details on using hashes here.

File details

Details for the file rattle_lint-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: rattle_lint-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 105.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for rattle_lint-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f0049d57c592714a74968227e20a4d6449ec58340b40f959455a8b7401662263
MD5 df45d9ec469a6f797e87cde378e6650a
BLAKE2b-256 d36e97bf0996a7a18bc54d251373401746df2d541363711354e0c58ec870af16

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page