Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CodeStyle][CINN] exclude cinn files in flake8 and ruff config #54974

Merged
merged 3 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
38 changes: 35 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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",
]