pyproject.toml 2.0 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
    "C408",
    "C409",
    "C410",
42
    "C411",
43 44 45 46 47 48
    # "C413",
    # "C414",
    # "C415",
    # "C416",
    # "C417",

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

    # NumPy-specific rules
    "NPY001",
85 86

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

    # Pylint
    "PLR0402",
121 122 123 124 125 126 127 128
]
unfixable = [
    "NPY001"
]

[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"]
"setup.py" = ["UP036"]