未验证 提交 c5087da8 编写于 作者: N Nyakku Shigure 提交者: GitHub

[CodeStyle] update flake8 config (#50458)

* update flake8 config

* remove _pb2 from linter ignore list

* refine config

* empty commit, test=document_fix
上级 b85af464
...@@ -6,8 +6,6 @@ exclude = ...@@ -6,8 +6,6 @@ exclude =
# https://github.com/PaddlePaddle/Paddle/pull/46290#discussion_r976392010 # https://github.com/PaddlePaddle/Paddle/pull/46290#discussion_r976392010
./python/paddle/fluid/[!t]**, ./python/paddle/fluid/[!t]**,
./python/paddle/fluid/tra**, ./python/paddle/fluid/tra**,
# Exclude auto-generated files
*_pb2.py,
# Exclude third-party libraries # Exclude third-party libraries
./python/paddle/utils/gast/**, ./python/paddle/utils/gast/**,
# Exclude files that will be removed in the future, see more at # Exclude files that will be removed in the future, see more at
...@@ -15,18 +13,16 @@ exclude = ...@@ -15,18 +13,16 @@ exclude =
./python/paddle/fluid/tests/unittests/npu/**, ./python/paddle/fluid/tests/unittests/npu/**,
./python/paddle/fluid/tests/unittests/mlu/** ./python/paddle/fluid/tests/unittests/mlu/**
ignore = ignore =
# E, see https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes E203, # Whitespace before ‘,’, ‘;’, or ‘:’, it is not compatible with black
E203, E402, # Module level import not at top of file
E402, E501, # Line too long (82 > 79 characters)
E501, E721, # Do not compare types, use `isinstance()`
E721,E722,E731,E741, E722, # Do not use bare except, specify exception instead
E731, # Do not assign a lambda expression, use a def
# F, see https://flake8.pycqa.org/en/latest/user/error-codes.html E741, # Do not use variables named ‘l’, ‘O’, or ‘I’
F405, F405, # `name` may be undefined, or defined from star imports: `module`
F841, F841, # Local variable name is assigned to but never used
W503 # Line break before binary operator, it is not compatible with black
# W, see https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
W503
per-file-ignores = per-file-ignores =
# These files need tabs for testing. # These files need tabs for testing.
python/paddle/fluid/tests/unittests/dygraph_to_static/test_error.py:E101,W191 python/paddle/fluid/tests/unittests/dygraph_to_static/test_error.py:E101,W191
......
...@@ -5,7 +5,6 @@ exclude: | ...@@ -5,7 +5,6 @@ exclude: |
paddle/fluid/framework/fleet/heter_ps/cudf/.+| paddle/fluid/framework/fleet/heter_ps/cudf/.+|
paddle/fluid/distributed/ps/thirdparty/round_robin.h| paddle/fluid/distributed/ps/thirdparty/round_robin.h|
python/paddle/utils/gast/.+| python/paddle/utils/gast/.+|
.+_pb2\.py|
python/paddle/fluid/tests/unittests/npu/.+| python/paddle/fluid/tests/unittests/npu/.+|
python/paddle/fluid/tests/unittests/mlu/.+ python/paddle/fluid/tests/unittests/mlu/.+
)$ )$
......
...@@ -13,7 +13,6 @@ extend_skip_glob = [ ...@@ -13,7 +13,6 @@ extend_skip_glob = [
# see .flake8 for more details # see .flake8 for more details
"python/paddle/fluid/[!t]**", "python/paddle/fluid/[!t]**",
"python/paddle/fluid/tra**", "python/paddle/fluid/tra**",
"*_pb2.py",
"python/paddle/utils/gast/**", "python/paddle/utils/gast/**",
"python/paddle/fluid/tests/unittests/npu/**", "python/paddle/fluid/tests/unittests/npu/**",
"python/paddle/fluid/tests/unittests/mlu/**", "python/paddle/fluid/tests/unittests/mlu/**",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册