diff --git a/.flake8 b/.flake8 index 853e887f5e40ac9aa2d61fa88d4e810a50c6cc81..3828a989ebe6f13992bc3cb997517e0791cf37ce 100644 --- a/.flake8 +++ b/.flake8 @@ -6,8 +6,6 @@ exclude = # https://github.com/PaddlePaddle/Paddle/pull/46290#discussion_r976392010 ./python/paddle/fluid/[!t]**, ./python/paddle/fluid/tra**, - # Exclude auto-generated files - *_pb2.py, # Exclude third-party libraries ./python/paddle/utils/gast/**, # Exclude files that will be removed in the future, see more at @@ -15,18 +13,16 @@ exclude = ./python/paddle/fluid/tests/unittests/npu/**, ./python/paddle/fluid/tests/unittests/mlu/** ignore = - # E, see https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes - E203, - E402, - E501, - E721,E722,E731,E741, - - # F, see https://flake8.pycqa.org/en/latest/user/error-codes.html - F405, - F841, - - # W, see https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes - W503 + E203, # Whitespace before ‘,’, ‘;’, or ‘:’, it is not compatible with black + E402, # Module level import not at top of file + E501, # Line too long (82 > 79 characters) + E721, # Do not compare types, use `isinstance()` + E722, # Do not use bare except, specify exception instead + E731, # Do not assign a lambda expression, use a def + E741, # Do not use variables named ‘l’, ‘O’, or ‘I’ + F405, # `name` may be undefined, or defined from star imports: `module` + F841, # Local variable name is assigned to but never used + W503 # Line break before binary operator, it is not compatible with black per-file-ignores = # These files need tabs for testing. python/paddle/fluid/tests/unittests/dygraph_to_static/test_error.py:E101,W191 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 816882418964313e8062ef14a7bc108e63dcaf78..d28d5adae30862e1641c0ffe70ce511b61efa5fa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,6 @@ exclude: | paddle/fluid/framework/fleet/heter_ps/cudf/.+| paddle/fluid/distributed/ps/thirdparty/round_robin.h| python/paddle/utils/gast/.+| - .+_pb2\.py| python/paddle/fluid/tests/unittests/npu/.+| python/paddle/fluid/tests/unittests/mlu/.+ )$ diff --git a/pyproject.toml b/pyproject.toml index 6bcec760a6c65a429ba766b4ce010538405fdc78..d42ee7ab0ec5408bd2c8a0014dd388f9f68fb657 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,6 @@ extend_skip_glob = [ # see .flake8 for more details "python/paddle/fluid/[!t]**", "python/paddle/fluid/tra**", - "*_pb2.py", "python/paddle/utils/gast/**", "python/paddle/fluid/tests/unittests/npu/**", "python/paddle/fluid/tests/unittests/mlu/**",