-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruff.toml
More file actions
executable file
·213 lines (206 loc) · 4.04 KB
/
ruff.toml
File metadata and controls
executable file
·213 lines (206 loc) · 4.04 KB
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
# SPDX-FileCopyrightText: 2025 Knitli Inc.
# SPDX-FileContributor: Adam Poulemanos <adam@knit.li>
#
# SPDX-License-Identifier: MIT OR Apache-2.0
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
"typings",
"tests/fixtures/malformed.py",
"tests/fixtures/sample_type_aliases.py",
]
extend-include = ["*.ipynb"]
fix = true
line-length = 100
indent-width = 4
target-version = "py312"
[format]
docstring-code-format = true
docstring-code-line-length = 80
line-ending = "auto"
indent-style = "space"
skip-magic-trailing-comma = true
exclude = [
"**/_vendor",
"setuptools/_distutils",
"setuptools/config/_validate_pyproject",
".venv",
".git",
".github",
".vscode",
".idea",
"dist",
"build",
"site",
"bin",
"lib",
"include",
"docs",
]
# Enable preview, required for quote-style = "preserve"
preview = true
# https://docs.astral.sh/ruff/settings/#format-quote-style
quote-style = "double"
[lint]
fixable = ["ALL"]
# Almost all rules; but not all https://docs.astral.sh/ruff/rules/
select = [
"A",
"ASYNC",
"B",
"C",
"D",
"E",
"F",
"FLY",
"FURB",
"G",
"I",
"ICN",
"INT",
"N",
"LOG",
"PD",
"PERF",
"PIE",
"PT",
"PTH",
"PYI",
"Q",
"RSE",
"RET",
"S",
"SLF",
"SLOT",
"SIM",
"TRY",
"RUF",
"UP",
"YTT",
"W",
]
extend-select = [
"A003",
"ANN201",
"ANN002",
"COM818",
"C901",
"DTZ005",
"DTZ007",
"FBT001",
"ISC003",
"TID252",
"TID253",
]
ignore = [
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191",
"E402",
"E111",
"E114",
"E117",
"D200",
"D205",
"D206",
"D300",
"D417",
"E501",
"Q000",
"Q001",
"Q002",
"Q003",
"PYI051", # redundant annotation with Literal and str -- we like to be explicit here
"COM812",
"COM819",
"ISC001",
"ISC002",
"D212",
"SLF001", # Private member accessed... it's not private for us.
"TRY003",
"UP015", # redundant-open-modes, explicit is preferred
]
exclude = [
".venv/",
"**/_vendor",
"setuptools/_distutils",
"setuptools/config/_validate_pyproject",
"typings",
]
[lint.pydocstyle]
convention = "google"
[lint.per-file-ignores]
"tests/fixtures/sample_type_aliases.py" = [
"UP040", # Intentionally using TypeAlias for backwards compatibility testing
]
"tests/*.py" = [
"ANN",
"C901", # too complex
"D",
"DTZ",
"FBT001", # boolean typed positional argument
"G004", # f-string in logging statement
"N806", # incorrect case for function name
"PT012", # pytest.raises() block should contain a single simple statement
"PT017", # Found assertion on exception in except block
"PT018", # Assertion should be broken down into multiple parts
"PT011", # pytest.raises() too broad
"B017", # Do not assert blind exception
"PTH",
"S",
"SIM",
"SLF001", # Private member accessed
"PYI024", # Use typing.NamedTuple instead of collections.namedtuple
]
"scripts/**/*.py" = [
"ANN",
"C901", # too complex
"D",
"DTZ",
"N806", # incorrect case for function name
"S108", # Probable insecure usage of temporary file or directory
"TRY300", # Consider moving this statement to an else block
"RUF001", # String contains ambiguous characters
]
"mise-tasks/**/*.py" = [
"ANN",
"C901", # too complex
"D",
"DTZ",
"N806", # incorrect case for function name
"S108", # Probable insecure usage of temporary file or directory
]
"src/exportify/__init__.py" = [
"S603", # This code only executes in development when _version.py is not present, and is safe because it does not use user input in the subprocess call.
]
[lint.isort]
force-single-line = false
force-wrap-aliases = false
lines-after-imports = 2
lines-between-types = 1
split-on-trailing-comma = false
[lint.extend-per-file-ignores]
"tests/fixtures/sample_type_aliases.py" = ["UP040"]