|
1 | 1 | # The following rules are incompatible with or enforced by black: |
2 | | -# E203 whitespace before ':' -- scripts only |
3 | | -# E301 expected 1 blank line |
4 | | -# E302 expected 2 blank lines |
5 | | -# E305 expected 2 blank lines |
6 | | -# E501 line too long |
| 2 | +# E203 whitespace before ':' -- scripts only |
| 3 | +# E301 expected 1 blank line |
| 4 | +# E302 expected 2 blank lines |
| 5 | +# E305 expected 2 blank lines |
| 6 | +# E501 line too long |
7 | 7 |
|
8 | 8 | # Some rules are considered irrelevant to stub files: |
9 | | -# E701 multiple statements on one line (colon) -- disallows "..." on the same line |
10 | | -# F401 imported but unused -- does not recognize re-exports |
| 9 | +# E701 multiple statements on one line (colon) -- disallows "..." on the same line |
| 10 | +# F401 imported but unused -- does not recognize re-exports |
11 | 11 | # https://github.com/PyCQA/pyflakes/issues/474 |
12 | | -# F822 undefined name in __all__ -- flake8 does not recognize 'foo: Any' |
| 12 | +# F822 undefined name in __all__ -- flake8 does not recognize 'foo: Any' |
13 | 13 | # https://github.com/PyCQA/pyflakes/issues/533 |
14 | 14 |
|
15 | 15 | # Rules that are out of the control of stub authors: |
16 | | -# E741 ambiguous variable name |
17 | | -# F403 import *' used; unable to detect undefined names |
18 | | -# F405 defined from star imports |
| 16 | +# E741 ambiguous variable name |
| 17 | +# F403 import *' used; unable to detect undefined names |
| 18 | +# F405 defined from star imports |
19 | 19 |
|
20 | 20 | # Rules that we'd like to enable in the future: |
21 | | -# Y037 Use PEP 604 syntax instead of `typing.Union` and `typing.Optional`. |
| 21 | +# Y037 Use PEP 604 syntax instead of `typing.Union` and `typing.Optional`. |
22 | 22 | # Currently can't be enabled due to a few lingering bugs in mypy regarding |
23 | 23 | # PEP 604 type aliases (see #4819). |
| 24 | +# NQA102 "noqa" code has no matching violations. We often introduce "noqa" comments |
| 25 | +# into the typeshed codebase to unblock flake8-pyi PRs, meaning these comments |
| 26 | +# have "no matching violations" since the relevant flake8-pyi checks haven't |
| 27 | +# yet been released. |
24 | 28 |
|
25 | 29 | [flake8] |
26 | 30 | per-file-ignores = |
27 | 31 | *.py: E203, E301, E302, E305, E501 |
28 | | - *.pyi: E301, E302, E305, E501, E701, E741, F401, F403, F405, F822, Y037 |
| 32 | + *.pyi: E301, E302, E305, E501, E701, E741, NQA102, F401, F403, F405, F822, Y037 |
29 | 33 | # Since typing.pyi defines "overload" this is not recognized by flake8 as typing.overload. |
30 | 34 | # Unfortunately, flake8 does not allow to "noqa" just a specific error inside the file itself. |
31 | 35 | # https://github.com/PyCQA/flake8/issues/1079 |
32 | 36 | # F811 redefinition of unused '...' |
33 | | - stdlib/typing.pyi: E301, E302, E305, E501, E701, E741, F401, F403, F405, F811, F822, Y037 |
| 37 | + stdlib/typing.pyi: E301, E302, E305, E501, E701, E741, NQA102, F401, F403, F405, F811, F822, Y037 |
34 | 38 | # Generated protobuf files include docstrings |
35 | | - *_pb2.pyi: E301, E302, E305, E501, E701, Y021, Y026 |
| 39 | + *_pb2.pyi: E301, E302, E305, E501, E701, NQA102, Y021, Y026 |
36 | 40 |
|
37 | 41 | exclude = .venv*,.git |
| 42 | +noqa_require_code = true |
0 commit comments