ruff-check

Run Ruff linter on Python code

TLDR

Check current directory
$ ruff check
Check specific files
$ ruff check [file.py]
Check and fix
$ ruff check --fix
Check with specific rules
$ ruff check --select [E,F]
Watch for changes
$ ruff check --watch

SYNOPSIS

ruff check [options] [files...]

DESCRIPTION

ruff check is the linting subcommand of Ruff, an extremely fast Python linter written in Rust. It analyzes Python source files for style violations, potential bugs, and code quality issues, implementing rule sets from Flake8, isort, pyupgrade, and many other established Python tools in a single unified interface.The --fix flag automatically corrects fixable violations in place, while --select and --ignore control which rule categories are active. Watch mode re-checks files on every save, providing real-time feedback during development. Output formats include plain text, JSON, and GitHub Actions annotations for CI integration.

PARAMETERS

--fix

Auto-fix violations.
--select rules
Enable specific rules.
--ignore rules
Ignore specific rules.
--watch
Watch for file changes.
--config file
Configuration file.
--output-format format
Output format (text, json, github).

INSTALL

sudo dnf install ruff
sudo pacman -S ruff
sudo apk add ruff
brew install ruff
nix profile install nixpkgs#ruff

SEE ALSO

ruff(1), ruff-format(1), flake8(1)