[tool.black] exclude = "build" line-length = 80 skip-string-normalization = true [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/**", ] [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 = [ # Pyflakes "F401", # Comprehensions "C4", # Pyupgrade "UP001", "UP003", "UP004", "UP005", "UP006", "UP007", "UP008", "UP009", "UP010", "UP011", "UP012", "UP013", "UP014", "UP017", "UP018", "UP019", "UP020", "UP021", "UP022", "UP023", "UP024", "UP025", "UP026", "UP027", "UP028", "UP029", # "UP030", # "UP031", # "UP032", "UP033", "UP034", "UP035", "UP036", # NumPy-specific rules "NPY001", # Bugbear "B002", "B003", "B004", # "B005", # "B006", # "B007", # "B008", "B009", "B010", "B011", "B012", "B013", "B014", "B015", "B016", # "B017", "B018", "B019", "B020", "B021", "B022", # "B023", # "B024", "B025", # "B026", # "B027", # "B028", "B029", # "B030", "B032", # "B904", # Pylint "PLC0414", # "PLC1901", "PLC3002", "PLE0100", "PLE0101", # "PLE0116", # "PLE0117", # "PLE0118", "PLE0604", "PLE0605", "PLE1142", "PLE1205", "PLE1206", "PLE1307", # "PLE1310", # "PLE1507", "PLE2502", # "PLE2510", # "PLE2512", # "PLE2513", # "PLE2514", # "PLE2515", # "PLR0133", # "PLR0206", "PLR0402", # "PLR0911", # "PLR0912", # "PLR0913", # "PLR0915", # "PLR1701", # "PLR1711", # "PLR1722", # "PLR2004", # "PLR5501", # "PLW0120", # "PLW0129", # "PLW0602", # "PLW0603", # "PLW0711", # "PLW1508", # "PLW2901", ] unfixable = [ "NPY001" ] [tool.ruff.per-file-ignores] # Ignore unused imports in __init__.py "__init__.py" = ["F401"] # Temporarily ignore test_slice.py to avoid PR-CI-CINN failure, please fix! "python/paddle/fluid/tests/unittests/dygraph_to_static/test_slice.py" = ["UP034"] # Ignore version check in setup.py "setup.py" = ["UP036"] # Ignore unnecessary comprehension in dy2st unittest test_loop "python/paddle/fluid/tests/unittests/dygraph_to_static/test_loop.py" = ["C416"] # Ignore unnecessary lambda in dy2st unittest test_lambda "python/paddle/fluid/tests/unittests/dygraph_to_static/test_lambda.py" = ["PLC3002"]