diff --git a/.flake8 b/.flake8 index 62f8772209809acae7b61f14269ac4d3bab66583..8916c0d8998a1c052ecb3edfac1c6fae6b2676c3 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 5259a735d819bbe4ff7b76b383e8b85eba5327e9..2439d0a1f3e8a109a6de2575db20ba8af1769c38 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", +]