2022-04-23 16:23:04 +03:00
|
|
|
[tool.black]
|
|
|
|
line-length = 120
|
2023-03-25 01:29:03 +03:00
|
|
|
# NOTE: Do not extend the exclude list. Edit .lintrunner.toml instead
|
2022-04-26 19:35:16 +03:00
|
|
|
extend-exclude = "cmake|onnxruntime/core/flatbuffers/"
|
2023-03-25 01:29:03 +03:00
|
|
|
target-version = ["py37", "py38", "py39", "py310", "py311"]
|
2022-04-23 16:23:04 +03:00
|
|
|
|
|
|
|
[tool.isort]
|
2023-03-25 01:29:03 +03:00
|
|
|
# NOTE: Do not extend the exclude list. Edit .lintrunner.toml instead
|
2022-04-23 16:23:04 +03:00
|
|
|
profile = "black"
|
|
|
|
line_length = 120
|
2022-04-26 19:35:16 +03:00
|
|
|
extend_skip_glob = [
|
|
|
|
"cmake/*",
|
|
|
|
"orttraining/*",
|
|
|
|
"onnxruntime/core/flatbuffers/*",
|
|
|
|
]
|
2022-04-23 16:23:04 +03:00
|
|
|
|
|
|
|
[tool.pydocstyle]
|
|
|
|
convention = "google"
|
2022-05-16 23:26:56 +03:00
|
|
|
|
2022-11-14 21:00:25 +03:00
|
|
|
[tool.pylint.BASIC]
|
|
|
|
good-names = [
|
|
|
|
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n",
|
|
|
|
"p", "q", "r", "s", "t", "u", "v", "w", "ex", "Run", "_", "x", "y", "z"
|
|
|
|
]
|
|
|
|
|
2022-07-27 23:42:29 +03:00
|
|
|
[tool.pylint.messages_control]
|
|
|
|
disable = [
|
|
|
|
"format",
|
|
|
|
"line-too-long",
|
|
|
|
"import-error",
|
|
|
|
"no-name-in-module",
|
|
|
|
"no-member",
|
2022-11-14 21:00:25 +03:00
|
|
|
"too-many-arguments",
|
|
|
|
"too-many-locals",
|
2022-07-27 23:42:29 +03:00
|
|
|
"too-few-public-methods",
|
|
|
|
"missing-docstring",
|
|
|
|
"fixme",
|
|
|
|
]
|
2022-05-16 23:26:56 +03:00
|
|
|
|
|
|
|
[tool.pyright]
|
|
|
|
exclude = ["onnxruntime/core/flatbuffers/*"]
|
|
|
|
reportMissingImports = false
|
2023-03-25 01:29:03 +03:00
|
|
|
|
|
|
|
[tool.ruff]
|
|
|
|
# NOTE: Do not create an exclude list. Edit .lintrunner.toml instead
|
2023-04-06 07:43:51 +03:00
|
|
|
target-version = "py38"
|
2023-03-25 01:29:03 +03:00
|
|
|
select = [
|
2023-07-21 22:53:41 +03:00
|
|
|
"B", # flake8-bugbear
|
2023-03-25 01:29:03 +03:00
|
|
|
"E", # pycodestyle
|
|
|
|
"F", # Pyflakes
|
2023-04-17 20:11:44 +03:00
|
|
|
"ISC", # flake8-implicit-str-concat
|
2023-07-21 22:53:41 +03:00
|
|
|
"N", # pep8-naming
|
|
|
|
"NPY", # numpy
|
|
|
|
"PERF", # Perflint
|
|
|
|
"PLC", # pylint conventions
|
|
|
|
"PLE", # pylint errors
|
|
|
|
"PLW", # pylint warnings
|
2023-03-25 01:29:03 +03:00
|
|
|
"RUF", # Ruff-specific rules
|
|
|
|
"SIM", # flake8-simplify
|
2023-07-21 22:53:41 +03:00
|
|
|
"T10", # flake8-debugger
|
2023-03-25 01:29:03 +03:00
|
|
|
"UP", # pyupgrade
|
2023-07-21 22:53:41 +03:00
|
|
|
"W", # pycodestyle
|
|
|
|
"YTT", # flake8-2020
|
2023-03-25 01:29:03 +03:00
|
|
|
]
|
|
|
|
# NOTE: Refrain from growing the ignore list unless for exceptional cases.
|
|
|
|
# Always include a comment to explain why.
|
|
|
|
ignore = [
|
2023-04-17 20:11:44 +03:00
|
|
|
"B028", # FIXME: Add stacklevel to warnings
|
2023-03-25 01:29:03 +03:00
|
|
|
"E501", # Line length controlled by black
|
|
|
|
"N803", # Argument casing
|
|
|
|
"N812", # Allow import torch.nn.functional as F
|
|
|
|
"N999", # Module names
|
2023-03-28 06:37:53 +03:00
|
|
|
"NPY002", # np.random.Generator may not always fit our use cases
|
2023-07-26 01:38:22 +03:00
|
|
|
"PERF203", # "try-except-in-loop" only affects Python <3.11, and the improvement is minor; can have false positives
|
|
|
|
"PERF401", # List comprehensions are not always readable
|
2023-03-25 01:29:03 +03:00
|
|
|
"SIM102", # We don't perfer always combining if branches
|
|
|
|
"SIM108", # We don't encourage ternary operators
|
|
|
|
"SIM114", # Don't combine if branches for debugability
|
|
|
|
"SIM116", # Don't use dict lookup to replace if-else
|
|
|
|
]
|
|
|
|
ignore-init-module-imports = true
|
|
|
|
unfixable = [
|
|
|
|
"F401", # Unused imports
|
2023-04-17 20:11:44 +03:00
|
|
|
"SIM112", # Use upper case for env vars
|
2023-03-25 01:29:03 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
[tool.ruff.per-file-ignores]
|
|
|
|
# NOTE: Refrain from growing the ignore list unless for exceptional cases.
|
|
|
|
# Prefer inline ignores with `noqa: xxx`.
|
|
|
|
# Eventually this list should become empty.
|
|
|
|
"orttraining/orttraining/test/**" = ["N802"] # Function casing
|
2023-04-17 20:11:44 +03:00
|
|
|
"tools/nuget/generate_nuspec_for_native_nuget.py" = ["ISC003"] # Too many errors to fix
|