2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 09:58:01 +00:00

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: https://github.com/PyCQA/flake8/pull/1974
1: https://github.com/PyCQA/pyflakes/pull/825
Signed-off-by: Frode Nordahl <fnordahl@ubuntu.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
Frode Nordahl 2025-03-30 15:29:56 +00:00 committed by Ilya Maximets
parent ba675897e4
commit 7f4ee43956

View File

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