Skip to content

Commit 65bcf31

Browse files
fnordahlmartinmo
authored andcommitted
python: Disable check for globals with never reassigned names (F824).
flake8 2.7.0 introduced the F824 check [0]. While the check sounds reasonable on the surface, we have code in the repository where the global variable is used only for access. My conclusion from evaluating the alternative of adjusting the code to appease the check is that it would invite future mistakes where the global variable is unintentionally shadowed in addition to making the code less clear and explicit. 0: PyCQA/flake8#1974 1: PyCQA/pyflakes#825 Signed-off-by: Frode Nordahl <[email protected]> Signed-off-by: Ilya Maximets <[email protected]> (cherry picked from commit 7f4ee43)
1 parent 5669e38 commit 65bcf31

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Makefile.am

+2-1
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,10 @@ ALL_LOCAL += flake8-check
398398
# W504 line break after binary operator
399399
# F*** -- warnings native to flake8
400400
# F811 redefinition of unused <name> from line <N> (only from flake8 v2.0)
401+
# F824 a `global` or `nonlocal` statement where the name is never reassigned
401402
# D*** -- warnings from flake8-docstrings plugin
402403
# H*** -- warnings from flake8 hacking plugin (custom style checks beyond PEP8)
403-
FLAKE8_IGNORE = E121,E123,E125,E126,E127,E128,E129,E131,E203,E722,W503,W504,F811,D,H,I
404+
FLAKE8_IGNORE = E121,E123,E125,E126,E127,E128,E129,E131,E203,E722,W503,W504,F811,F824,D,H,I
404405
flake8-check: $(FLAKE8_PYFILES)
405406
$(FLAKE8_WERROR)$(AM_V_GEN) \
406407
src='$^' && \

0 commit comments

Comments
 (0)