Files
Ruff will run on files with the following extensions:.py.ipynb(using nbqa)
Configuration
Ruff supports the following config files:pyproject.tomlruff.toml.ruff.toml
When we skip Ruff
CodeRabbit will skip running Ruff when:- Ruff is already running in GitHub workflows.
Ignored codes
The following Ruff codes are automatically ignored:I001- unsorted importsF401- unused importsW291- 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 executable
Profile behavior
In Chill mode, Ruff uses a focused set of rule codes including Pyflakes (F), flake8-bugbear (B), flake8-bandit (S), and other essential 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)
S101 (use of assert) is ignored in test files.