Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Ruff

$ ruff Official Low Risk
Astral · Code & DevOps · MIT · macos / linux / windows

Astral'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.

FCRS-1.0 Score
95 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install ruff
CLI vs MCP Decision CLI Only

Runs sub-100ms local Python AST linting and formatting directly on workspace files.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
✓ Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 24 / 25

Supports --output-format=json (plus sarif, concise, gitlab), --diff, NO_COLOR=1, and sub-50ms deterministic execution.

  • ruff check --output-format=json includes exact spans and fix edits
  • ruff format --check --diff previews formatting cleanly
Trust & Safety 23 / 25

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 --fix or format (without --check) is passed
Setup & Portability 15 / 15

Single static Rust binary available via Homebrew, PyPI, uvx, Cargo, and GitHub Releases.

  • Fast standalone executable across macOS, Linux, and Windows
Utility & Efficiency 14 / 15

Replaces half a dozen slow Python linters/formatters with millisecond feedback loops.

  • 800+ lint rules plus Black-compatible formatter in one tool
Maintenance & Lineage 10 / 10

Official Astral project (astral-sh/ruff) under MIT license with massive Python ecosystem adoption.

  • Actively maintained by Astral under MIT license
Docs & Verifiability 9 / 10

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

Auth Modes
No Auth
Credential Storage

Purely local static analysis; no credentials stored or required.

Side Effects
Read-Only Local Write
Cost & Quotas

MIT open-source Rust binary; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Lint Python files with JSON diagnostics
ruff check --output-format=json .

Emits machine-readable JSON diagnostics with exact file, line, column, rule code, and fix metadata.

Preview formatting changes without editing
ruff format --check --diff .

Checks formatting compliance and shows unified diffs without modifying any files.

Controlled Writes & Previews

Apply safe lint fixes and format files
ruff check --fix . && ruff format .

Applies safe auto-fixes and formats Python files deterministically.

Strengths for Agents

  • + ruff check --output-format=json delivers exact locations, rule IDs, and structured fix suggestions.
  • + Safe vs --unsafe-fixes separation plus --diff prevents 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 mypy or pyright).
  • ! Passing --unsafe-fixes can alter program semantics if unreviewed.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI