diff --git a/changelog.d/9370.misc b/changelog.d/9370.misc new file mode 100644 index 000000000000..9acf7844a6c6 --- /dev/null +++ b/changelog.d/9370.misc @@ -0,0 +1 @@ +Explicitly select flake8 checks (as opposed to the defaults). \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index f46e43fad0bb..62c559438547 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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