-
Notifications
You must be signed in to change notification settings - Fork 5
/
pyproject.toml
221 lines (203 loc) · 6.72 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
[build-system]
requires = ["setuptools>=50.3.2", "wheel", "setuptools-declarative-requirements", "setuptools_scm[toml]>=3.4"]
build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
write_to = "src/saf/version.py"
write_to_template = "# pylint: skip-file\n\n__version__ = \"{version}\""
[tool.black]
line-length = 100
[tool.towncrier]
filename = "CHANGELOG.rst"
directory = "changelog/"
template = "changelog/_template.rst"
[[tool.towncrier.type]]
directory = "breaking"
name = "Breaking Changes"
showcontent = true
[[tool.towncrier.type]]
directory = "deprecation"
name = "Deprecations"
showcontent = true
[[tool.towncrier.type]]
directory = "feature"
name = "Features"
showcontent = true
[[tool.towncrier.type]]
directory = "improvement"
name = "Improvements"
showcontent = true
[[tool.towncrier.type]]
directory = "bugfix"
name = "Bug Fixes"
showcontent = true
[[tool.towncrier.type]]
directory = "doc"
name = "Improved Documentation"
showcontent = true
[[tool.towncrier.type]]
directory = "trivial"
name = "Trivial/Internal Changes"
showcontent = true
[tool.ruff]
line-length = 120
select = ["ALL"]
show-fixes = true
show-source = true
target-version = "py37"
respect-gitignore = true
src = [
"src",
"tests",
"tools",
"examples",
]
extend-exclude = [
".nox/**",
"examples/pipelines/**",
]
extend-include = [
"setup.py",
"noxfile.py",
"src/**/*.pyi",
]
ignore = [
# D* pydocstyle
"D200", # Reformat to one line
"D212", # Remove whitespace after opening quotes
"COM", # flake8-commas - Black takes care of this
"ERA", # eradicate
"SIM108", # Use ternary operator `A = X if Y else Z` instead of `if`-`else`-block
"PERF203", # `try`-`except` within a loop incurs performance overhead"
"PERF401", # Use a list comprehension to create a transformed list
"PERF402", # Use `list` or `list.copy` to create a copy of a list
]
ignore-init-module-imports = true
builtins = [
"__opts__",
"__salt__",
# "__context__",
# "__grains__",
# "__pillar__",
"__salt_system_encoding__",
]
# Group violations by containing file.
format = "grouped"
[tool.ruff.per-file-ignores]
"src/**/*.py" = [
"D104", # Missing docstring in public package
"D107", # Missing docstring in `__init__`
]
"examples/src/**/*.py" = [
"D104", # Missing docstring in public package
"D107", # Missing docstring in `__init__`
]
"src/**/*.pyi" = [
"D100", # Missing docstring in public module
]
"src/saf/models.py" = [
"D106", # Missing docstring in public nested class
"SLF001", # Private member accessed"
"ARG003", # Unused class method argument: `kwargs`
]
"src/saf/pipeline.py" = [
"PERF401", # Use a list comprehension to create a transformed list"
]
"src/saf/collect/file.py" = [
"TCH003", # Move standard library import `pathlib` into a type-checking block
]
"src/saf/forward/disk.py" = [
"TCH003", # Move standard library import `pathlib` into a type-checking block
]
"src/saf/forward/test.py" = [
"TCH003", # Move standard library import `pathlib` into a type-checking block
]
"src/saf/saltext/**/*.py" = [
"N807", # Function name should not start and end with `__`
]
"src/saf/utils/salt.py" = [
"ANN101", # Missing type annotation for `self` in method
"PLR0913", # Too many arguments to function call (10 > 5)
"FBT001", # Boolean positional arg in function definition
"FBT002", # Boolean default value in function definition
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in `**kwargs`
"RET504", # Unnecessary variable assignment before `return` statement
]
"setup.py" = [
"D",
]
"noxfile.py" = [
"D",
"ANN",
"PTH",
"SLF001",
"C901",
"PLR0912",
"DTZ005",
"FBT002",
"PLR0913", # Too many arguments to function call"
"PLR0915", # Too many statements
]
"tools/**/*.py" = [
"ANN201", # Missing return type annotation for public function"
"D104", # Missing docstring in public package
"FBT001", # Boolean positional arg in function definition
"FBT002", # Boolean default value in function definition
]
"tests/**/*.py" = [
"ANN", # Ignore missing type annotations in tests
"ARG001", # Unused function argument
"D100", # Missing docstring in public module
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"DTZ003", # The use of `datetime.datetime.utcnow()` is not allowed, use `datetime.datetime.now(tz=)` instead
"PLR2004", # Magic value used in comparison, consider replacing 3 with a constant variable
"PT001", # use @pytest.fixture() over @pytest.fixture
"PT023", # use @pytest.mark.<blah>() over @pytest.mark.<blah>
"RET504", # Unnecessary variable assignment before `return` statement"
"S101", # Ignore the use of 'assert ...' in tests
"S603", # `subprocess` call: check for execution of untrusted input
"SIM117", # Use a single `with` statement with multiple contexts instead of nested `with` statements
"TCH002", # Move third-party import into a type-checking block
"TCH003", # Move standard library import `pathlib` into a type-checking block
]
"examples/tests/**/*.py" = [
"ANN", # Ignore missing type annotations in tests
"ARG001", # Unused function argument
"D100", # Missing docstring in public module
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"DTZ003", # The use of `datetime.datetime.utcnow()` is not allowed, use `datetime.datetime.now(tz=)` instead
"PLR2004", # Magic value used in comparison, consider replacing 3 with a constant variable
"PT001", # use @pytest.fixture() over @pytest.fixture
"PT023", # use @pytest.mark.<blah>() over @pytest.mark.<blah>
"RET504", # Unnecessary variable assignment before `return` statement"
"S101", # Ignore the use of 'assert ...' in tests
"S603", # `subprocess` call: check for execution of untrusted input
"SIM117", # Use a single `with` statement with multiple contexts instead of nested `with` statements
"TCH002", # Move third-party import into a type-checking block
"TCH003", # Move standard library import `pathlib` into a type-checking block
]
"tests/unit/process/test_regex_mask.py" = [
"S105", # Possible hardcoded password
]
[tool.ruff.pydocstyle]
# Use Google-style docstrings.
convention = "google"
[tool.ruff.isort]
combine-as-imports = false
force-single-line = true
known-first-party = ["src"]
forced-separate = ["tests"]
[tool.ruff.flake8-quotes]
docstring-quotes = "double"
[tool.ruff.pep8-naming]
ignore-names = [
"__virtual__",
]
[tool.ruff.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true
[tool.ruff.mccabe]
max-complexity = 20
[tool.ruff.pylint]
max-branches = 25