Skip to content

Commit

Permalink
[CodeStyle][F401] update flake8 F401 config (unittests/npu,xpu,mlu,ip…
Browse files Browse the repository at this point in the history
…u) (PaddlePaddle#46792)

* exclude python code that auto-generated by protoc

* [CodeStyle][F401] update flake8 F401 config (unittests/npu,xpu,mlu,ipu)

* add npu, mlu to `exclude` field

* empty commit, test=document_fix
  • Loading branch information
SigureMo authored Oct 12, 2022
1 parent 72fecaa commit 4bbb0b3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
14 changes: 9 additions & 5 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ exclude =
# A trick to exclude fluid/ but keep fluid/tests/, see more at
# https://github.com/PaddlePaddle/Paddle/pull/46290#discussion_r976392010
./python/paddle/fluid/[!t]**,
./python/paddle/fluid/tra**
./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
# https://github.com/PaddlePaddle/Paddle/pull/46782#issuecomment-1273033731
./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
E121,E122,E123,E125,E126,E127,E128,E129,E131,
Expand Down Expand Up @@ -60,11 +68,7 @@ per-file-ignores =
python/paddle/metric/*:F401
python/paddle/fluid/tests/unittests/ir/*:F401
python/paddle/fluid/tests/unittests/tokenizer/*:F401
python/paddle/fluid/tests/unittests/xpu/*:F401
python/paddle/fluid/tests/unittests/distribution/*:F401
python/paddle/fluid/tests/unittests/mlu/*:F401
python/paddle/fluid/tests/unittests/npu/*:F401
python/paddle/fluid/tests/unittests/ipu/*:F401
python/paddle/fluid/tests/unittests/distributed_passes/*:F401
python/paddle/fluid/tests/unittests/auto_parallel/*:F401
python/paddle/fluid/tests/unittests/dygraph_to_static/*:F401
Expand Down
7 changes: 5 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Exclude all third-party libraries globally
# Exclude all third-party libraries and auto-generated files globally
exclude: |
(?x)^(
patches/.+|
paddle/fluid/framework/fleet/heter_ps/cudf/.+|
paddle/fluid/distributed/ps/thirdparty/round_robin.h|
python/paddle/utils/gast/.+
python/paddle/utils/gast/.+|
.+_py2\.py|
python/paddle/fluid/tests/unittests/npu/.+|
python/paddle/fluid/tests/unittests/mlu/.+
)$
repos:
- repo: https://github.com/Lucas-C/pre-commit-hooks.git
Expand Down

0 comments on commit 4bbb0b3

Please sign in to comment.