Skip to content
Latchkey

ruff check: Fast Linting Command Reference

Lint a Python codebase in milliseconds.

ruff check runs a fast Rust-based linter over your code, reporting style and correctness issues. Its speed makes it ideal as an early, cheap CI gate.

Common flags / usage

  • ruff check . -- lint the whole tree
  • --fix -- auto-fix violations that are safe to fix
  • --no-fix -- report only, never modify (CI default)
  • --output-format=github -- emit GitHub Actions annotations
  • --select / --ignore RULES -- tune the active rule set

Example

shell
- run: pip install ruff
- run: ruff check --output-format=github .

In CI

Run ruff check without --fix in CI so it fails on violations instead of silently rewriting code. --output-format=github turns findings into inline PR annotations. Pair with "ruff format --check" to enforce formatting too.

Key takeaways

  • ruff check is a very fast linter, good as an early CI gate.
  • Use --output-format=github for inline PR annotations.
  • Keep --fix out of CI so violations fail rather than auto-rewrite.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →