LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

ruff-check

Run Ruff linter on Python code

TLDR

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

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).

SEE ALSO

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

Copied to clipboard
Kai