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.1a3.tar.gz (313.1 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.1a3-cp311-abi3-win_amd64.whl (549.9 kB view details)

Uploaded CPython 3.11+Windows x86-64

rude-0.1a3-cp311-abi3-musllinux_1_2_x86_64.whl (846.8 kB view details)

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

rude-0.1a3-cp311-abi3-musllinux_1_2_aarch64.whl (787.1 kB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

rude-0.1a3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (633.3 kB view details)

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

rude-0.1a3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (609.2 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

rude-0.1a3-cp311-abi3-macosx_11_0_arm64.whl (584.8 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

rude-0.1a3-cp311-abi3-macosx_10_12_x86_64.whl (609.8 kB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for rude-0.1a3.tar.gz
Algorithm Hash digest
SHA256 e0cfd824dcc1966df163d6dc91609778e2a2d99e0e6ffb89921a95c0d58dc2ae
MD5 4ab15b762064eb386b99e3653f02e074
BLAKE2b-256 adccc4c33a025c1672fe34ded843e159789c7c4698ad5e929def385f6811cf79

See more details on using hashes here.

Provenance

The following attestation bundles were made for rude-0.1a3.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.1a3-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: rude-0.1a3-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 549.9 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.1a3-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b0038dfeeea1566be4675ce2fa5468ddb9cd55757d80a9e0d5fded6dcd0870b5
MD5 0ce7da47654363edc71e22034c3db75c
BLAKE2b-256 e13ea3e928ae49afbeb0d1bc38843c9eedf4c98375ab9a57361d43974a44c5c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for rude-0.1a3-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.1a3-cp311-abi3-musllinux_1_2_x86_64.whl.

File metadata

  • Download URL: rude-0.1a3-cp311-abi3-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 846.8 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.1a3-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 56ff7b62528a14ed7d270ce89176d10547335035fb7a84a9d25832d9afee7a24
MD5 75df83ac197e2eab3dfe44dbbeecdcca
BLAKE2b-256 18ea921393c4cb61bf05de2f027ca36f0b81a265a5311a3cf0921e96a897ca4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for rude-0.1a3-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.1a3-cp311-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for rude-0.1a3-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 d5bdcf336ea4af16a4c7981491426e1f2c188762cf8f107529422992434ba04a
MD5 fef49302f0d5f47d94420e2a42d8a0b6
BLAKE2b-256 96dd2a7c59e3b1d2041c4f04381d772a6b8dd1fbf221471af5d547e97aad786d

See more details on using hashes here.

Provenance

The following attestation bundles were made for rude-0.1a3-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.1a3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rude-0.1a3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a5ac1e0e585e8ddb7f4cd622d76b3b8fe3d9770cb4d99a957106800c8445bec3
MD5 321d3d9108d4aeeac67e9b69ebe1f231
BLAKE2b-256 056cbd8c12211d747a6d03580fa32b8424147bbabb49badbded6d86331f0b6c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for rude-0.1a3-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.1a3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rude-0.1a3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2cd5802aace45874f5604f445ac8c712ae61e1d79a6a142bddc605ff4d10da08
MD5 ebd4ad490affc74bf77d63b7850b03b0
BLAKE2b-256 08fc46c2ab1ac90fe1eb39e3af71ded4f4c6cc36042f4a68ff970ed1926704c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for rude-0.1a3-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.1a3-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: rude-0.1a3-cp311-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 584.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.1a3-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 40a16f7cdd7abd697ea8d751771e0cb904c1e54610bcb19d331a30fcf7da75a6
MD5 a8a343f3a966bff4eac8c68048dd5420
BLAKE2b-256 82cf9205e8206466ee9369dc021326c01176e09caaab72a287da8a9004b3f919

See more details on using hashes here.

Provenance

The following attestation bundles were made for rude-0.1a3-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.1a3-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rude-0.1a3-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3f77ecdb7867d495632553700354240445cbe27d524d0c6cb1199d5fcf6e60f7
MD5 8e8359f54c9264074287e03450cf1262
BLAKE2b-256 fb12f67035583451728a9da60d3190f04c50823d58cc6dc533ff920a65927946

See more details on using hashes here.

Provenance

The following attestation bundles were made for rude-0.1a3-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