pyproject.toml 2.7 KB
Newer Older
1 2 3 4
[tool.black]
exclude = "build"
line-length = 80
skip-string-normalization = true
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

[tool.isort]
profile = "black"
line_length = 80
known_first_party = ["paddle"]
skip = ["build", "__init__.py"]
extend_skip_glob = [
    # These files do not need to be formatted,
    # see .flake8 for more details
    "python/paddle/fluid/[!t]**",
    "python/paddle/fluid/tra**",
    "python/paddle/utils/gast/**",
    "python/paddle/fluid/tests/unittests/npu/**",
    "python/paddle/fluid/tests/unittests/mlu/**",
]
20 21 22 23 24 25 26 27 28 29 30 31

[tool.ruff]
exclude = [
    "./build",
    "./python/paddle/fluid/[!t]**",
    "./python/paddle/fluid/tra**",
    "./python/paddle/utils/gast/**",
    "./python/paddle/fluid/tests/unittests/npu/**",
    "./python/paddle/fluid/tests/unittests/mlu/**",
]
target-version = "py37"
select = [
32 33 34
    # Pyflakes
    "F401",

35 36 37 38
    # Comprehensions
    "C400",
    "C401",
    "C402",
39 40 41
    "C403",
    "C404",
    "C405",
42 43 44
    "C408",
    "C409",
    "C410",
45
    "C411",
46 47 48 49 50 51
    # "C413",
    # "C414",
    # "C415",
    # "C416",
    # "C417",

52 53 54
    # Pyupgrade
    "UP001",
    "UP003",
55
    "UP004",
56
    "UP005",
57
    "UP007",
58
    "UP008",
59
    "UP009",
60
    "UP010",
61
    "UP011",
62
    "UP012",
63 64 65
    "UP013",
    "UP014",
    "UP017",
66
    "UP018",
67 68 69 70 71
    "UP019",
    "UP020",
    "UP021",
    "UP022",
    "UP023",
72
    "UP024",
73 74
    "UP025",
    "UP026",
75
    "UP027",
76
    "UP028",
77
    "UP029",
78 79 80
    # "UP030",
    # "UP031",
    # "UP032",
81
    "UP033",
82
    # "UP034",
83 84 85 86 87
    "UP035",
    "UP036",

    # NumPy-specific rules
    "NPY001",
88 89

    # Bugbear
90 91 92 93 94 95 96
    "B002",
    "B003",
    # "B004",
    # "B005",
    # "B006",
    # "B007",
    # "B008",
97 98
    "B009",
    "B010",
99
    "B011",
100 101 102 103
    "B012",
    "B013",
    "B014",
    # "B015",
G
gouzil 已提交
104
    "B016",
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
    # "B017",
    "B018",
    "B019",
    # "B020",
    "B021",
    "B022",
    # "B023",
    # "B024",
    "B025",
    # "B026",
    # "B027",
    # "B028",
    "B029",
    # "B030",
    "B032",
    # "B904",
121 122

    # Pylint
123
    "PLC0414",
124
    # "PLC1901",
125
    "PLC3002",
126 127 128 129 130 131 132 133
    "PLE0100",
    "PLE0101",
    # "PLE0116",
    # "PLE0117",
    # "PLE0118",
    "PLE0604",
    "PLE0605",
    "PLE1142",
134
    "PLE1205",
135 136 137 138 139 140 141 142 143 144 145 146
    "PLE1206",
    "PLE1307",
    # "PLE1310",
    # "PLE1507",
    "PLE2502",
    # "PLE2510",
    # "PLE2512",
    # "PLE2513",
    # "PLE2514",
    # "PLE2515",
    # "PLR0133",
    # "PLR0206",
147
    "PLR0402",
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
    # "PLR0911",
    # "PLR0912",
    # "PLR0913",
    # "PLR0915",
    # "PLR1701",
    # "PLR1711",
    # "PLR1722",
    # "PLR2004",
    # "PLR5501",
    # "PLW0120",
    # "PLW0129",
    # "PLW0602",
    # "PLW0603",
    # "PLW0711",
    # "PLW1508",
    # "PLW2901",
164 165 166 167 168 169 170 171
]
unfixable = [
    "NPY001"
]

[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"]
"setup.py" = ["UP036"]
172
"python/paddle/fluid/tests/unittests/dygraph_to_static/test_lambda.py" = ["PLC3002"]