-
Notifications
You must be signed in to change notification settings - Fork 197
/
pyproject.toml
97 lines (88 loc) · 4.36 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
[tool.black]
# Black has been replaced with Ruff.
# This section should be removed later, but kept here to avoid IDE extensions from messing up the code.
line-length = 160
force-exclude = '''python-avd/pyavd/_cv/api/.*'''
[tool.isort]
# Isort has been replaced with Ruff.
# This section should be removed later, but kept here to avoid IDE extensions from messing up the code.
extend_skip_glob = [
"python-avd/pyavd/_cv/api/**/*"
]
profile = "black"
skip_gitignore = true
line_length = 160
known_first_party = ["pyavd", "schema_tools"]
[tool.ruff]
line-length = 160
extend-exclude = [
"python-avd/pyavd/_cv/api/**/*",
"ansible_collections/arista/avd/tests/**/*",
]
target-version = "py310"
[tool.ruff.lint]
extend-select = ["ALL"]
ignore = [
"ANN101", # Missing type annotation for `self` in method - we know what self is..
"ANN102", # Missing type annotation for `cls` in classmethod - we know what cls is..
"D203", # Ignoring conflicting D* warnings - one-blank-line-before-class
"D212", # Ignoring conflicting D* warnings - multi-line-summary-first-line
"COM812", # Ignoring conflicting rules that may cause conflicts when used with the formatter
"ISC001", # Ignoring conflicting rules that may cause conflicts when used with the formatter
"TD002", # We don't have require authors in TODO
"TD003", # We don't have an issue link for all TODOs today
"FIX002", # Line contains TODO - ignoring for ruff for now
"F821", # Disable undefined-name until resolution of #10451
"SLF001", # Accessing private members - TODO: Improve code
"D100", # Missing docstring in public module - TODO: Improve code
"D101", # Missing docstring in public class - TODO: Improve code
"D102", # Missing docstring in public method - TODO: Improve code
"D103", # Missing docstring in public function - TODO: Improve code
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method - TODO: Improve code
"D106", # Missing docstring in public nested class - TODO: Improve code
"D107", # Missing docstring in `__init__` - TODO: Improve code
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed - TODO: Improve code
"C901", # complex-structure - TODO: Improve code
"FBT001", # Boolean-typed positional argument in function definition - TODO: Improve code
"FBT002", # Boolean default positional argument in function definition - TODO: Improve code
"PD011", # Use numpy instead of .values - False positive
"BLE001", # Do not catch blind exception: `Exception - TODO: Improve code
"PLR2004", # Magic value used in comparison - TODO: Evaluate
"DTZ005", # `datetime.datetime.now()` called without a `tz` argument - TODO: Improve code
"UP038", # UP038 Use `X | Y` in `isinstance` call instead of `(X, Y)` - Why would I? It impacts performance.
"ASYNC109",# async-function-with-timeout: Our async functions call several other async functions and we need each of those calls to be governed by the configurable timeout.
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"ansible_collections/arista/avd/plugins/*/*.py" = [
"E402", # Ansible plugins require a layout with imports below the docs
"INP001", # implicit namespace package. Add an `__init__.py` - Ansible plugins are not in packages
]
"ansible_collections/arista/avd/roles/eos_validate_state/python_modules/**/*.py" = [
"INP001", # implicit namespace package. Add an `__init__.py` - Will be fixed once moved to PyAVD
]
"ansible_collections/arista/avd/molecule/eos_designs_unit_tests/custom_modules/*.py" = [
"INP001", # implicit namespace package. Add an `__init__.py` - TODO: Evaluate or see if it is a false positive
]
"python-avd/scripts/**/*.py" = [
"T201", # Interactive scripts can have print
"INP001", # implicit namespace package. Add an `__init__.py` - TODO: Evaluate or see if it is a false positive
]
"python-avd/pyavd/_cv/client/*.py" = [
"B904", # Within an `except` clause, raise exceptions with `raise - TODO: Improve code
]
"python-avd/tests/**/*" = [
"S101", # Accept 'assert' in pytest.
"INP001", # implicit namespace package. Add an `__init__.py` - Tests are not in packages
]
[tool.ruff.lint.pylint]
max-args = 12
max-branches = 54
max-returns = 10
max-statements = 148
[tool.ruff.lint.isort]
known-first-party = ["pyavd", "schema_tools"]
[tool.ruff.format]
docstring-code-format = true