From bb1181328aee1bbcf637fa4ba8e5d040415a5289 Mon Sep 17 00:00:00 2001 From: gouzil <66515297+gouzil@users.noreply.github.com> Date: Thu, 29 Jun 2023 10:06:03 +0800 Subject: [PATCH] [CodeStyle][CINN] exclude cinn files in flake8 and ruff config (#54974) * [codestyle] add exclude * refine config * empty commit, test=document_fix --------- Co-authored-by: SigureMo --- .flake8 | 21 ++++++++++++++++++--- pyproject.toml | 38 +++++++++++++++++++++++++++++++++++--- 2 files changed, 53 insertions(+), 6 deletions(-) diff --git a/.flake8 b/.flake8 index 62f87722098..8916c0d8998 100644 --- a/.flake8 +++ b/.flake8 @@ -7,9 +7,6 @@ exclude = # Exclude third-party libraries ./third_party/**, ./python/paddle/utils/gast/**, - # Temporarily ignore CINN files, it will fix later - ./python/cinn/**, - ./test/cinn/**, ignore = # Whitespace before ‘,’, ‘;’, or ‘:’, it is not compatible with black E203, @@ -30,3 +27,21 @@ ignore = per-file-ignores = # These files need tabs for testing. test/dygraph_to_static/test_error.py:E101,W191 + # Temporarily ignore CINN files, it will fix later + python/cinn/**: + E265, + test/cinn/**: + E126, + E231, + E251, + E265, + E266, + E401, + E711, + W291, + W504, + paddle/cinn/**: + E265, + tools/cinn/**: + E265, + E401, diff --git a/pyproject.toml b/pyproject.toml index 5259a735d81..2439d0a1f3e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,9 +29,6 @@ exclude = [ "third_party", "./python/paddle/fluid/**", "./python/paddle/utils/gast/**", - # Temporarily ignore CINN files, it will fix later - "python/cinn/**", - "test/cinn/**", ] target-version = "py37" select = [ @@ -103,3 +100,38 @@ ignore = [ "test/dygraph_to_static/test_loop.py" = ["C416", "F821"] # Ignore unnecessary lambda in dy2st unittest test_lambda "test/dygraph_to_static/test_lambda.py" = ["PLC3002"] +# Temporarily ignore CINN files, it will fix later +"python/cinn/**" = [ + "F401", + "F403", + "UP004", +] +"test/cinn/**" = [ + "F401", + "F403", + "F632", + "F811", + "F821", + "F901", + "C408", + "C417", + "UP004", + "UP008", + "UP027", + "UP032", + "UP034", + "PLR0402", + "PLC0414", + "PLE1205", +] +"paddle/cinn/**" = [ + "UP032", +] +"tools/cinn/**" = [ + "F401", + "C416", + "UP004", + "UP031", + "UP032", + "PLR0402", +] -- GitLab