v0.16.9.
Files
Ruff will run on files with the following extensions:.py.ipynb(using nbQA)
Configuration
boolean
default:true
Enable Ruff
string
Optional path to a Ruff configuration file relative to the repository. When set, this configuration is used for every reviewed file instead of Ruffâs closest-config discovery.
- .coderabbit.yaml
- Web UI
.coderabbit.yaml
pyproject.tomlruff.toml.ruff.toml
config_file must be a repository-relative path. If it is a URL, an absolute path, contains .., or does not exist, CodeRabbit skips Ruff for the review.
When config_file is not set, Ruff finds the closest applicable configuration for each reviewed file by searching its directory hierarchy. If no repository configuration applies, CodeRabbit uses an isolated fallback configuration based on the selected review profile.
Ruff runs inside the CodeRabbit sandbox. Repository configuration is parsed there by Ruff; CodeRabbit does not load user-provided plugins or Python init hooks.
When we skip Ruff
CodeRabbit will skip running Ruff when:- Ruff is already running in GitHub Actions, GitLab CI, CircleCI, or Azure Pipelines.
Ignored codes
The following Ruff codes are automatically ignored:I001- unsorted importsF401- unused importsF405- undefined name from star importW291- trailing whitespaceW293- blank line contains whitespaceQ000- bad quotesANN001- missing type annotationANN201- missing return type annotationUP006- deprecated type aliasUP045- deprecated importE501- line too longS101- use of assert detectedEXE001- Shebang is present but file is not executableRUF100- unusednoqadirectivePT009- pytest unittest assertionLOG015- root logger callPLR2004- magic-value-comparisonPLR0913- too-many-argumentsPLR0917- too-many-positional-argumentsF841- unused-variableF811- redefinition-of-unused-namePIE794- duplicate class field definition
E402 in __init__.py and conftest.py files.
Profile behavior
These rule selections apply to CodeRabbitâs generated fallback configuration. A repository configuration or an explicitconfig_file supplies its own rule selections; CodeRabbit still filters the ignored codes from review comments.
In Chill mode, Ruff uses a focused set of rule codes including Pyflakes (F), flake8-bugbear (B), flake8-bandit (S), flake8-blind-except (BLE), flake8-debugger (T10), flake8-executable (EXE), Ruff-specific bug rules (RUF), Pylint error checks (PLE), flake8-builtins (A), and selected pycodestyle checks.
In Assertive mode, Ruff additionally enables:
ANN- flake8-annotations (type annotations)ASYNC- flake8-async (async/await issues)FBT- flake8-boolean-trapC4- flake8-comprehensionsDTZ- flake8-datetimez (timezone issues)DJ- flake8-djangoISC- flake8-implicit-str-concatLOG- flake8-loggingG- flake8-logging-formatPIE- flake8-piePT- flake8-pytest-styleFLY- flynt (f-string opportunities)UP- pyupgrade (upgrade opportunities)PLR- Pylint refactor checksSIM- flake8-simplifyPERF- perflintRET- flake8-returnARG- flake8-unused-argumentsTRY- tryceratopsPLW- Pylint warning checks