Open-Source Wikis

/

Ruff

/

Ruff and ty

/

Glossary

astral-sh/ruff

Glossary

Project-specific vocabulary that recurs across this repo.

Term Meaning
Rule A single lint check, identified by a code (e.g. F401, E501, RUF019). Defined under crates/ruff_linter/src/rules/.
Rule code Short alphanumeric identifier. The prefix indicates the origin (F = Pyflakes, E/W = pycodestyle, B = bugbear, RUF = Ruff-native, PL* = Pylint, UP = pyupgrade, PYI = flake8-pyi, etc.).
Rule selector A user-facing pattern that selects rules by code prefix (E, E5, E501) or category (ALL, EXTEND). Implemented in crates/ruff_linter/src/rule_selector.rs.
Linter The Ruff product that runs rules over a file. Lives in crates/ruff_linter.
Checker One of the per-pass visitors that drives rules (AST checker, tokens checker, physical-line checker, logical-line checker, imports checker, filesystem checker, noqa checker). See crates/ruff_linter/src/checkers/.
Fix A machine-applicable code edit attached to a diagnostic. Categorized as Safe, Unsafe, or Display (suggestion only). Implemented in crates/ruff_diagnostics.
Noqa A # noqa comment that suppresses one or more rules on a line. Parsed by crates/ruff_linter/src/noqa.rs.
Per-file ignore Configuration that suppresses rules for files matching a glob, set via lint.per-file-ignores.
Preview Unstable rules and behavior gated behind preview = true or --preview. Tracked in crates/ruff_linter/src/preview.rs.
Settings The fully resolved, strongly-typed configuration for a workspace, produced by crates/ruff_workspace.
Workspace (Ruff) The set of files, settings, and per-file overrides that Ruff resolves before linting.
Pyproject A pyproject.toml file with a [tool.ruff] section. Ruff also reads top-level ruff.toml / .ruff.toml.
AST Abstract syntax tree, defined in crates/ruff_python_ast. Produced by the parser; consumed by linter, formatter, and ty.
Trivia Whitespace and comments between tokens. Handled by crates/ruff_python_trivia.
Semantic model The post-parse name resolution / scope graph in crates/ruff_python_semantic::SemanticModel. Lint rules use it to decide what a name binds to.
mdtest A Markdown-driven test format used heavily by ty. Each .md file describes Python sources and expected diagnostics. Crate: crates/mdtest. Fixtures live under crates/ty_python_semantic/resources/mdtest.
Insta The snapshot-testing crate (cargo insta accept, .snap files) used by both products.
Salsa The incremental computation framework underpinning ty. Tracked queries are cached and recomputed on demand when their inputs change.
Database (ty) A type implementing ruff_db::Database and Salsa traits, holding files and tracked computations. See crates/ty_python_semantic::db.
System The file-system abstraction in ruff_db::system. Implementations: native, in-memory, WASM.
ty Astral's Python type checker. Originally code-named red_knot, kicked off in April 2024.
red_knot Old name for ty (still appears in some commit messages).
Project (ty) A ty_project::Project — a directory of Python files plus a configuration loaded from pyproject.toml or ty.toml.
Vendored (ty) Bundled typeshed stubs at crates/ty_vendored/.
Site-packages Installed package metadata + sources discovered via crates/ty_site_packages.
Playground Public web UIs at https://play.ruff.rs (Ruff) and the ty playground. Source under playground/.
cargo dev Internal CLI in crates/ruff_dev for codegen, schema regeneration, format-stability checks, and the round-trip parser test. Run with cargo dev <subcommand>.
prek Pre-commit-style hook runner used in this repo (faster than pre-commit). Installed via uv tool install prek.
uvx uv tool run. Used to invoke Ruff from the released wheel during development workflows.
fixable / unfixable Configuration switches that decide which rules' fixes are applied when --fix is set.
Logical line A Python logical line (after joining continuations and parens). Counted by crates/ruff_python_index.
Source range A byte range in a file using ruff_text_size::TextSize / TextRange.
CodeFrame A rendered diagnostic snippet showing source lines with annotations (powered by ruff_annotate_snippets).

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Glossary – Ruff wiki | Factory