Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Explicitly add flake8 selections #9370

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/9370.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Explicitly select flake8 checks (as opposed to the defaults).
38 changes: 30 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,36 @@ ignore =
tox.ini

[flake8]
# see https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
# for error codes. The ones we ignore are:
# W503: line break before binary operator
# W504: line break after binary operator
# E203: whitespace before ':' (which is contrary to pep8?)
# E731: do not assign a lambda expression, use a def
# E501: Line too long (black enforces this for us)
ignore=W503,W504,E203,E731,E501
select=
# Errors and Warnings
# https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
E, W
# pyflakes
# https://flake8.pycqa.org/en/latest/user/error-codes.html
F
# mccabe
# https://github.com/pycqa/mccabe#plugin-for-flake8
# (not enabled unless max-complexity is set)
C90
# flake8-comprehensions
# https://github.com/adamchainz/flake8-comprehensions#rules
C4

# Ignored checks take precedence over selected checks.
# Please also include a description as to why to include these, if possible.
ignore=
# "line break before binary operator"
W503
# "line break after binary operator"
W504
# "Whitespace before ':'"
# (Used to circumvent colon-in-slice-index false-positives, see #9368)
E203
# "Do not assign a lambda expression, use a def"
E731
# "Line too long"
# (No need to check with flake8, black enforces this for us)
E501

[isort]
line_length = 88
Expand Down