Supported Files
Flake8 will run on files with the following extensions:*.py*.ipynb(using nbqa)
Configuration
Flake8 supports the following config files:.flake8
When we skip Flake8
CodeRabbit will skip running Flake8 when:- No config file is found (
.flake8). - Flake8 is already running in GitHub workflows.
Excluded codes
The following Flake8 codes are automatically excluded (style and whitespace issues that won’t cause runtime errors):E501- line too longE302,E303,E305- blank line issuesW291,W292,W293,W391- whitespace issuesE201,E202,E203,E211- whitespace around bracketsE221,E222,E225,E226,E227,E228- whitespace around operatorsE231,E241,E242,E251- whitespace around commasE261,E262- inline comment spacingE271,E272,E273,E274,E275- whitespace around keywordsE301,E304,E306- blank line issuesE401,E402,E411- import grouping issuesE502- redundant backslashW191- indentation contains tabsE266- too many leading ’#’ for block comment
Profile behavior
In Chill mode, Flake8 filters out warnings and conventions, reporting only errors. In Assertive mode, all findings (errors, warnings, and conventions) are reported.Features
Flake8 can detect many issues such as:- Style violations (PEP 8)
- Logical errors and unused imports
- Code complexity issues
- Syntax errors
- And many more