@codacy/tools-ruff-0
v0.2.0
Published
Ruff adapter — CLI-mode Python linter
Readme
@codacy/tools-ruff-0
Table of Contents
Overview
Python linter using the Ruff binary. Ruff is an extremely fast Python linter written in Rust that implements rules from Flake8, isort, pyupgrade, and many other tools. Uses the CLI execution strategy.
| Property | Value |
|----------|-------|
| Tool ID | Ruff |
| Codacy UUID | aac6ad5e-093d-47c4-97ff-87f91d6128a2 |
| Strategy | CLI |
| Languages | Python |
| Binary | ruff |
| File patterns | **/*.py, **/*.pyi, **/*.ipynb |
| Pattern count | ~773 |
Updating patterns
# Re-fetch pattern metadata from the Codacy API
pnpm prefetch
# Commit the result
git add src/patterns.jsonPattern IDs follow the format Ruff_F401_unused-import, Ruff_E501_line-too-long, etc.
Updating the Ruff version
- Update
preferredVersioninsrc/adapter.ts - Run
pnpm prefetch— Ruff adds new rules frequently - Run
pnpm testto verify compatibility - If the major version changes, create a new adapter package (
ruff-1/)
Development
pnpm build # Build with tsup
pnpm test # Run tests (requires ruff in PATH or auto-install)Notes for maintainers
- Ruff is a standalone Rust binary, downloaded from GitHub releases as a
.tar.gzarchive. - Installation uses
downloadAndExtract()withstripComponents: 1because the archive wraps the binary in a directory (e.g.ruff-aarch64-apple-darwin/ruff). - JSON output via
ruff check --output-format json. --exit-zeroensures exit code 0 even when findings exist.--no-cachedisables Ruff's file cache for reproducible results.- When patterns are specified, a
ruff.tomlconfig withselect = [...]is generated. - Config file search order:
.ruff.toml,ruff.toml,pyproject.toml.
