Skip to main content

A fast, extensible Python linter for custom rules

Project description

Rude

License Python versions PyPI version

A fast, extensible Python linter for custom rules.
Complements Ruff by letting you write custom lint rules in Python — with Rust-powered analysis under the hood.
17x faster than Flake8 single-threaded. Custom lint rules in Python, with Rust-powered analysis.

Linting Django (901 files) — 10 equivalent rules, single process
Linting Django (901 files) -- 10 equivalent AST rules, single process


Getting started

# Lints the current workdir
$ uvx rude check

$ uv tool install rude
$ rude --version
rude 0.1a2



# Add rude to your project
uv add rude --dev

Write your first rule

from rude import Rule, Node, NodeType, Diagnostic
from collections.abc import Iterator

class NoDebugPrint(Rule):
    code = "DBG001"
    message = "Debug print() found"
    node_types = {NodeType.CALL}

    def check(self, node: Node) -> Iterator[Diagnostic]:
        if node.function_name == "print":
            yield self.diagnostic(node)

Two base classes: Rule (AST nodes) and LineRule (raw text). Rules can provide autofixes with import management.

Register as a plugin or as local rules:

# pyproject.toml
[project.entry-points."rude.plugins"]
my_plugin = "my_plugin"

[tool.rude]
local-rules = ["tools/linting/rules.py"]

Key features

  • Severity levels -- ERROR breaks CI, WARNING doesn't. Four levels (error, warning, info, hint) per rule, filterable with --quiet.
  • Template rules -- lint without writing Python. Ban calls, require base classes, enforce decorators -- all from pyproject.toml.
  • Autofix with imports -- Fix.replace(node, text, imports_from=[...]) handles insertion, deduplication, and placement automatically.
  • Fast -- Rust-powered tree-sitter parsing and semantic analysis. Streaming pipeline keeps memory flat across a project (buffered when --fix rewrites files); the GIL is released during per-file Rust analysis.
  • Rich Node API -- node.function_name, node.inherits_from("Base"), node.decorator_names. No raw tree-sitter needed.
  • 104 built-in rules -- pyflakes (F), pycodestyle (E/W), McCabe (C901). Additional rule sets can be added via third-party plugins or local Python rule files.

The sweet spot

Standard rules Custom rules Speed Memory Severity
Ruff 800+ none fastest low all fatal
Rude 104 + plugins unlimited fast low 4 levels
Flake8 100+ (plugins) via packages slow medium all fatal
Fixit ~30 via LibCST slow high all fatal

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

rude-0.1a4.tar.gz (325.4 kB view details)

Uploaded Source

Built Distributions

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

rude-0.1a4-cp311-abi3-win_amd64.whl (553.4 kB view details)

Uploaded CPython 3.11+Windows x86-64

rude-0.1a4-cp311-abi3-musllinux_1_2_x86_64.whl (842.3 kB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ x86-64

rude-0.1a4-cp311-abi3-musllinux_1_2_aarch64.whl (782.9 kB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

rude-0.1a4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (628.9 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64

rude-0.1a4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (606.0 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

rude-0.1a4-cp311-abi3-macosx_11_0_arm64.whl (587.8 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

rude-0.1a4-cp311-abi3-macosx_10_12_x86_64.whl (613.3 kB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file rude-0.1a4.tar.gz.

File metadata

  • Download URL: rude-0.1a4.tar.gz
  • Upload date:
  • Size: 325.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rude-0.1a4.tar.gz
Algorithm Hash digest
SHA256 435b2e842625dfd2f4c258103f2195c0194ccefe301b48a4ef1004185fe7e8fb
MD5 943ab258f0e59881238cecfe978c99c0
BLAKE2b-256 d6b45935ec9d8a6983234db5a3eb49ac1174a55dd0809ce47598c42ba8205d2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for rude-0.1a4.tar.gz:

Publisher: release.yml on rude-dev/rude

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rude-0.1a4-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: rude-0.1a4-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 553.4 kB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rude-0.1a4-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 84307e8ec544cff6499c8bab20be032769fc3cab56f667563d8c4f520f423b08
MD5 ddee5ab803c395cac7f94f1884cead62
BLAKE2b-256 d9b58d06b35bb675e3c73bf130d043f2d4ba1447bc006555dbe5495fa9a20867

See more details on using hashes here.

Provenance

The following attestation bundles were made for rude-0.1a4-cp311-abi3-win_amd64.whl:

Publisher: release.yml on rude-dev/rude

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rude-0.1a4-cp311-abi3-musllinux_1_2_x86_64.whl.

File metadata

  • Download URL: rude-0.1a4-cp311-abi3-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 842.3 kB
  • Tags: CPython 3.11+, musllinux: musl 1.2+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rude-0.1a4-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b73576a78802f9a24d7abf848e81bff5280d9151a5f5bfd1813a086270360bd0
MD5 550ea14ae2105e201548903500fea49e
BLAKE2b-256 1b0ab49dd866ecc44a1c90c5a7ac6712eb3af71568a363766c78f29e8c5c3103

See more details on using hashes here.

Provenance

The following attestation bundles were made for rude-0.1a4-cp311-abi3-musllinux_1_2_x86_64.whl:

Publisher: release.yml on rude-dev/rude

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rude-0.1a4-cp311-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for rude-0.1a4-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 b269be355c2529d36bf1f1cac2c7b4f5812853cc2d54fe41ec01a419f0529246
MD5 ee26353009c502507505070b9a3ec5ad
BLAKE2b-256 89a79e311fba7ded223b3ffeceeee584c2943d531d9211fee6d5e369d88117c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for rude-0.1a4-cp311-abi3-musllinux_1_2_aarch64.whl:

Publisher: release.yml on rude-dev/rude

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rude-0.1a4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rude-0.1a4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e076477f9e206338521d50493cf9044a2353b37b778d0cb974ac0f4bc85828a0
MD5 f8fb1b9dff87361869a93c84b76bb3f5
BLAKE2b-256 865de720b313a6c4af07f1908b7893f2a79bf006ea2abc88428225ebc20d41ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for rude-0.1a4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on rude-dev/rude

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rude-0.1a4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rude-0.1a4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ecd5c9cc437b724fb02bc31c23d2b8097e793dbc2afbe0ecc8a008d82ec309fb
MD5 9a23397803e30dabd679590e5a39fa28
BLAKE2b-256 65279e66d10d14b2c82d1d23035b5598d8ef5690084784cbdafb741392288ed9

See more details on using hashes here.

Provenance

The following attestation bundles were made for rude-0.1a4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on rude-dev/rude

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rude-0.1a4-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: rude-0.1a4-cp311-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 587.8 kB
  • Tags: CPython 3.11+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rude-0.1a4-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d00b1c712aca0e5effa764002e26cce308fa58c0a67959fd625440146d38edc9
MD5 7274995ae3755ccbc2b042ce2c94dafc
BLAKE2b-256 44a7cb737d4c54ffff04364c5b85dcea12fdb351eb3ce8fb72df5d5e33129e9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for rude-0.1a4-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on rude-dev/rude

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rude-0.1a4-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rude-0.1a4-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 09a6360c413dc1b366be7a574b7e0ed873824740074bcbd2aed82a7727791464
MD5 39e731163a8d747790ced83d919c4996
BLAKE2b-256 66b23f2167a938d330f7b897d72d9a6a727e2a31285c6f682171a6f1bb9455eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for rude-0.1a4-cp311-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on rude-dev/rude

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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