forked from PaddlePaddle/Paddle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
137 lines (129 loc) · 2.58 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
[tool.black]
line-length = 80
skip-string-normalization = true
extend-exclude = '''
(
third_party/.+ # Exclude third_party directory
| build/.+ # Exclude build directory
)
'''
[tool.isort]
profile = "black"
line_length = 80
known_first_party = ["paddle"]
skip = ["build", "third_party", "__init__.py"]
extend_skip_glob = [
# These files do not need to be formatted,
# see .flake8 for more details
"python/paddle/fluid/**",
"python/paddle/utils/gast/**",
# Temporarily ignore CINN files, it will fix later
"python/cinn/**",
"test/cinn/**",
]
[tool.ruff]
exclude = [
"./build",
"third_party",
"./python/paddle/fluid/**",
"./python/paddle/utils/gast/**",
]
target-version = "py37"
select = [
# Pyflakes
"F",
# Comprehensions
"C4",
# Pyupgrade
"UP",
# NumPy-specific rules
"NPY001",
# Bugbear
"B002",
"B003",
"B004",
"B009",
"B010",
"B011",
"B012",
"B013",
"B014",
"B015",
"B016",
"B017",
"B018",
"B019",
"B020",
"B021",
"B022",
"B025",
"B029",
"B032",
# Pylint
"PLE",
"PLC0414",
"PLC3002",
"PLR0206",
"PLR0402",
]
unfixable = [
"NPY001"
]
ignore = [
# `name` may be undefined, or defined from star imports: `module`
"F405",
# Local variable name is assigned to but never used
"F841",
# It not met the "Explicit is better than implicit" rule
"UP015",
# It will cause the performance regression on python3.10
"UP038",
]
[tool.ruff.per-file-ignores]
# Ignore unused imports in __init__.py
"__init__.py" = ["F401"]
# Ignore undefined variables in CMake config and some dygraph_to_static tests
".cmake-format.py" = ["F821"]
"test/dygraph_to_static/test_closure_analysis.py" = ["F821"]
"python/paddle/static/amp/decorator.py" = ["F821"]
# Ignore version check in setup.py
"setup.py" = ["UP036"]
# Ignore unnecessary comprehension in dy2st unittest test_loop
"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",
]