From 348f46452f8a864c5e0f279398fad0a943f67ab1 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Fri, 5 May 2023 18:27:41 +0100 Subject: [PATCH] flake8: Enable F822 (#10144) --- .flake8 | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.flake8 b/.flake8 index dbf8b47ff..a7c558c14 100644 --- a/.flake8 +++ b/.flake8 @@ -20,30 +20,24 @@ # E701 multiple statements on one line (colon) -- disallows "..." on the same line # F401 imported but unused -- does not recognize re-exports # https://github.com/PyCQA/pyflakes/issues/474 -# F822 undefined name in __all__ -- flake8 does not recognize 'foo: Any' -# https://github.com/PyCQA/pyflakes/issues/533 # Rules that are out of the control of stub authors: # E741 ambiguous variable name # F403 import *' used; unable to detect undefined names # F405 defined from star imports -# Ignored to workaround pyflakes issues with stub files -# (the bugs this rule catches are caught by our other tests anyway): -# F821 undefined name - [flake8] extend-ignore = A, D, N8, SIM, RST, TYP, E301, E302, E305, E501 per-file-ignores = *.py: E203 - *.pyi: B, E701, E741, F401, F403, F405, F822 + *.pyi: B, E701, E741, F401, F403, F405 # Since typing.pyi defines "overload" this is not recognized by flake8 as typing.overload. # Unfortunately, flake8 does not allow to "noqa" just a specific error inside the file itself. # https://github.com/PyCQA/flake8/issues/1079 # F811 redefinition of unused '...' - stdlib/typing.pyi: B, E701, E741, F401, F403, F405, F811, F822 + stdlib/typing.pyi: B, E701, E741, F401, F403, F405, F811 # Generated protobuf files include docstrings - # *_pb2.pyi: B, E701, E741, F401, F403, F405, F822, Y021, Y026, Y053, Y054 + # *_pb2.pyi: B, E701, E741, F401, F403, F405, Y021, Y026, Y053, Y054 # TODO: Re-enable flake8 on generated protobuf files # after https://github.com/nipunn1313/mypy-protobuf/issues/523 is resolved