pyproject.toml 1.4 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 42
    "C408",
    "C409",
    "C410",
    
43 44 45
    # Pyupgrade
    "UP001",
    "UP003",
46
    "UP004",
47
    "UP005",
48
    "UP007",
49
    "UP008",
50
    "UP010",
51
    "UP011",
52
    "UP012",
53 54 55
    "UP013",
    "UP014",
    "UP017",
56
    "UP018",
57 58 59 60 61 62 63 64 65 66 67 68 69 70
    "UP019",
    "UP020",
    "UP021",
    "UP022",
    "UP023",
    "UP025",
    "UP026",
    "UP029",
    "UP033",
    "UP035",
    "UP036",

    # NumPy-specific rules
    "NPY001",
71 72 73 74

    # Bugbear
    "B009",
    "B010",
75
    "B011",
76 77 78 79 80 81 82 83
]
unfixable = [
    "NPY001"
]

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