mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Summary:
Similar to https://github.com/pytorch/pytorch/issues/48201, this PR excludes a file that is auto-generated by [`test/test_type_hints.py`](5834438090/test/test_type_hints.py (L109-L111)
), which doesn't happen to be run before the Flake8 check is done in CI. Also, because the `exclude` list in `.flake8` has gotten fairly long, this PR splits it across multiple lines.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/50497
Test Plan:
Run this in your shell:
```sh
python test/test_type_hints.py TestTypeHints.test_doc_examples
flake8
```
- _Before:_ `flake8` prints [these 169 false positives](https://pastebin.com/qPJY24g8) and returns exit code 1
- _After:_ `flake8` prints no output and returns exit code 0
Reviewed By: mrshenli
Differential Revision: D25903177
Pulled By: samestep
fbshipit-source-id: 21f757ac8bfa626bb56ece2ecc55668912b71234
34 lines
1000 B
INI
34 lines
1000 B
INI
[flake8]
|
|
select = B,C,E,F,P,T4,W,B9
|
|
max-line-length = 120
|
|
# C408 ignored because we like the dict keyword argument syntax
|
|
# E501 is not flexible enough, we're using B950 instead
|
|
ignore =
|
|
E203,E305,E402,E501,E721,E741,F403,F405,F821,F841,F999,W503,W504,C408,E302,W291,E303,
|
|
# shebang has extra meaning in fbcode lints, so I think it's not worth trying
|
|
# to line this up with executable bit
|
|
EXE001,
|
|
# these ignores are from flake8-bugbear; please fix!
|
|
B007,B008,
|
|
# these ignores are from flake8-comprehensions; please fix!
|
|
C400,C401,C402,C403,C404,C405,C407,C411,C413,C414,C415
|
|
per-file-ignores = __init__.py: F401 torch/utils/cpp_extension.py: B950
|
|
exclude =
|
|
docs/src,
|
|
docs/cpp/src,
|
|
venv,
|
|
third_party,
|
|
caffe2,
|
|
scripts,
|
|
docs/caffe2,
|
|
torch/lib/include,
|
|
torch/lib/tmp_install,
|
|
build,
|
|
torch/include,
|
|
*.pyi,
|
|
.git,
|
|
build,
|
|
build_test_custom_build,
|
|
build_code_analyzer,
|
|
test/generated_type_hints_smoketest.py
|