Ruff
$ ruff Official Low RiskAstral's high-speed Python linter and code formatter written in Rust, replacing Flake8, isort, pyupgrade, and Black. Gives coding agents sub-second diagnostics via ruff check --output-format=json and non-destructive --diff / --check previews.
brew install ruff Runs sub-100ms local Python AST linting and formatting directly on workspace files.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --output-format=json (plus sarif, concise, gitlab), --diff, NO_COLOR=1, and sub-50ms deterministic execution.
ruff check --output-format=jsonincludes exact spans and fix editsruff format --check --diffpreviews formatting cleanly
Zero network/auth surface; separates safe vs --unsafe-fixes and supports --diff before writing files.
- Separates safe fixes from
--unsafe-fixes - Read-only by default unless
--fixorformat(without--check) is passed
Single static Rust binary available via Homebrew, PyPI, uvx, Cargo, and GitHub Releases.
- Fast standalone executable across macOS, Linux, and Windows
Replaces half a dozen slow Python linters/formatters with millisecond feedback loops.
- 800+ lint rules plus Black-compatible formatter in one tool
Official Astral project (astral-sh/ruff) under MIT license with massive Python ecosystem adoption.
- Actively maintained by Astral under MIT license
Exceptional rule documentation (ruff rule <code>) and CLI reference at docs.astral.sh/ruff/.
- Self-describing
ruff rule <code >and online docs
Security, Auth & Guardrails
Purely local static analysis; no credentials stored or required.
MIT open-source Rust binary; completely free.
# Ruff (ruff) Agent Rules - Always run `ruff check --output-format=json .` when parsing Python lint errors. - Avoid `--unsafe-fixes` unless explicitly reviewing the diff first with `ruff check --fix --unsafe-fixes --diff`.
Agent-Ready Command Recipes
Safe Read-Only Queries
ruff check --output-format=json .
Emits machine-readable JSON diagnostics with exact file, line, column, rule code, and fix metadata.
ruff format --check --diff .
Checks formatting compliance and shows unified diffs without modifying any files.
Controlled Writes & Previews
ruff check --fix . && ruff format .
Applies safe auto-fixes and formats Python files deterministically.
Strengths for Agents
- +
ruff check --output-format=jsondelivers exact locations, rule IDs, and structured fix suggestions. - + Safe vs
--unsafe-fixesseparation plus--diffprevents silent semantic changes. - + Millisecond speed keeps agent edit-verify loops practically instantaneous.
Caveats & Pitfalls
- ! Does not perform full cross-module Python type checking (pair with
mypyorpyright). - ! Passing
--unsafe-fixescan alter program semantics if unreviewed.