-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpyproject.toml
214 lines (192 loc) · 8.61 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
[tool.ruff]
# ruff 0.2.2
line-length = 105
target-version = "py37"
extend-exclude = ["django-pam"]
[tool.ruff.lint]
external = ["W601", "F812", "E403", "E704"]
ignore-init-module-imports = true
select = ["ALL"]
ignore = [
"T20", # allow use of print()
"N", # ignore non PEP-8 conform names
"ANN", # missing type annotation
"ERA", # don't remove commented out code
"ARG", # ignore unused arguments
"EM", # ignore strings instead of variable preference in exception raising
"FBT", # ignore boolean trap in function arguments
"DTZ", # ignore use of datetime without explicit timezone given
"PTH", # don't use pathlib for everything
"RSE102", # we want parentheses when raising exceptions
"D100", "D101", "D102", "D103", "D104", "D105", "D106", "D107", # ignore missing docstring
"D203", # ignore 1 blank line required before class docstring, conflicts with D211
"D212", # multiline docstring should not start at first line!
"D214", "D215", "D405", "D406", "D407", "D408", "D409", "D410", "D411", "D412", "D413", "D414", "D416", # we don't have sections
"D400", # first line should end with period
"D415", # first line should end with period, question, exclamation: maybe somewhen?!
"UP031", # allow %-interpolation
"PD011", # we don't use pandas
"INP001", # implicit namespace package
"EXE001", # Shebang is present but file is not executable
"S101", # allow to use assert (must be used in pytest)
"S105", "S106", "S107", # allow hardcoded password
"SLF001", # allow private member access
"Q000", # allow single quotes
"Q001", # allow single quote multiline strings
"RET502", # allow implicit return None
"RET503", # allow missing explicit return None
"B905", # allow zip() without an explicit strict= parameter
"RUF001", # allow ambiguous-unicode-character-string
"PLR2004", # allow magic-value-comparison
"A001", "A002", "A003", # allow builtin-variable-shadowing
"B006", # allow mutable-argument-default
"B008", # allow function-call-argument-default
"BLE001", # allow catching Exception (blind-except)
"PLR0911", # too-many-return-statements
"PLR0912", # too-many-branches
"PLR0913", # too-many-args
"PLR0915", # too-many-statements
"PLW2901", # redefined-loop-name
# current violations
"FIX001", #
"FIX002", #
"TD001",
"TD002",
"TD003",
"S311", # suspicious-non-cryptographic-random-usage
"S603", # subprocess-without-shell-equals-true
"S607", # start-process-with-partial-path
"RUF012", # mutable-class-default
"FLY002", #
"B007", # unused-loop-control-variable
"PLR1701", # Merge these isinstance calls: `isinstance(pk, (int, string_types))`
"PLW0120", # Else clause on loop without a break statement, remove the else and de-indent all the code inside it
"B011", # Do not `assert False` (`python -O` removes these calls), raise `AssertionError()`
"B023", # Function definition does not bind loop variable `idomain`
"B026", # Star-arg unpacking after a keyword argument is strongly discouraged
"ISC001", # Implicitly concatenated string literals on one line
"SIM101", # Multiple `isinstance` calls for `pk`, merge into a single call
"SIM114", # if-with-same-arms
"SIM201", # Use `command != "r"` instead of `not command == "r"`
"SIM210", # Use `bool(reg and reg.groupdict()['context_type'] == 'school')` instead of `True if reg and reg.groupdict()['context_type'] == 'school' else False`
"SIM300", # Yoda conditions are discouraged, use `context_obj.props.contextid == DEFAULT_CONTEXT_ID` instead
"UP030", # Use implicit references for positional format fields
"UP034", # Avoid extraneous parentheses
"D417", # Missing argument descriptions in the docstring: `base_dn`, `must_exist`, `ou`
"PT015", # Assertion always fails, replace with `pytest.fail()`
"PIE790", # Unnecessary `pass` statement
"COM812", # Trailing comma missing
"EXE002", # The file is executable but no shebang is present
"B026", # Keyword argument `request` must come after starred arguments
# # not py2 compatible
"UP004", "UP008", "UP009", "UP010", "UP025", "UP029", # be Python 2 compatible
"YTT202", # six-py3-referenced
"RUF005", # unpack-instead-of-concatenating-to-collection-literal
"TCH", # type checking
# "S324", # hashlib-insecure-hash-function
"S113", # request-without-timeout
"S108", # hardcoded-temp-file
"S103", # bad-file-permissions
"S110", # try-except-pass
# "UP006", # use-pep585-annotation
"UP003", # type-of-primitive
"UP012", # unnecessary-encode-utf8
# #"UP016", # remove-six-compat
"UP018", # native-literals
# "UP019", # typing-text-str-alias
"UP020", # open-alias
# "UP023", # rewrite-c-element-tree
"UP024", # os-error-alias
"UP026", # rewrite-mock-import
"UP028", # rewrite-yield-from
"UP032", # f-string
"UP035", # import-replacements
# "UP036", # outdated-version-block
# F401: not py2 compat because of "typing" type hint comments: https://github.com/charliermarsh/ruff/issues/1619
# would be nice but no autofix available
"TID252", # relative-imports
"B904", # allow raise-without-from-inside-except → too many violations
"RET505", # superfluous-else-return
"RET506", # superfluous-else-raise
"RET507", # superfluous-else-continue
"RET508", # superfluous-else-break
"SIM115", # open-file-with-context-handler
"SIM102", # nested-if-statements
"SIM105", # use-contextlib-suppress
"G", # logging
"TRY", # tryceratops
"PT004", "PT007", "PT011", "PT012", "PT017", "PT018", # pytest
# "PGH003", # blanket-type-ignore
"UP014", # convert-named-tuple-functional-to-class
"RET504", # unnecessary-assign, https://github.com/astral-sh/ruff/issues/2263
"SIM117", # multiple-with-statements
"SIM108", # use-ternary-operator: hm, sometimes great, sometimes not
"D205", # 1 blank line required between summary line and description
"D300", # Use """triple double quotes"""
"D301", # Use r""" if any backslashes in a docstring
"D401", # First line of docstring should be in imperative mood
"D402", # First line should not be the function's signature
"D403", # First word of the first line should be properly capitalized
"D404", # First word of the docstring should not be "This"
"PLW0603", # global-statement to update identifiers
"PIE804", # no-unnecessary-dict-kwargs
"PLR5501", # collapsible-else-if
"PYI033", # type-comment-in-stub
"PYI024", #
"PYI048", #
"TD004", #
"TD005", #
"FA100", #
"FA102", # future-required-type-annotation
"PLC1901", #
"FIX004",
"SIM112", #
"PERF203", # try-except-in-loop
"PERF401", # manual-list-comprehension
"DJ012", # django-unordered-body-content-in-model
"SIM118", # unsure if everything is a dict, let's select each individually somewhen
# issues in ruff:
"RUF100", # https://github.com/astral-sh/ruff/issues/2406, https://github.com/astral-sh/ruff/issues/2407
]
unfixable = ["RUF100", "T20"]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
allowed-confusables = ["’", "`", "´"]
task-tags = ["TODO", "FIXME"]
[tool.ruff.lint.flake8-builtins]
builtins-ignorelist = ["copyright", "license", "object", "exit", "quit", "credits"]
[tool.ruff.lint.mccabe]
max-complexity = 72
[tool.ruff.format]
quote-style = "double"
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
multiline-quotes = "double"
inline-quotes = "double"
[tool.ruff.lint.flake8-unused-arguments]
ignore-variadic-names = true
[tool.ruff.lint.flake8-pytest-style]
parametrize-names-type = "csv"
[tool.ruff.lint.flake8-annotations]
ignore-fully-untyped = true
[tool.ruff.lint.isort]
combine-as-imports = true
#filter-files = true
#force-grid-wrap = false
known-first-party = ["ucsschool", "univention"]
known-third-party = ["ConfigParser", "PyQt4", "StringIO", "apt", "cStringIO", "celery", "colorlog", "commands", "cups", "dateutil", "django", "django_filters", "dns", "ipaddr", "lazy_object_proxy", "ldap", "ldif", "listener", "magic", "mock", "netifaces", "psutil", "pycurl", "pytest", "requests", "rest_framework", "ruamel", "samba", "sip", "six", "smbpasswd", "urllib3", "urlparse", "utils", "wakeonlan"]
#multi-line-output = 3
#include-trailing-comma = true
# for legacy support / lookup of old config:
[tool.isort]
py_version = "37"
combine_as_imports = true
filter_files = true
force_grid_wrap = false
known_first_party = "ucsschool,univention"
known_third_party = "ConfigParser,PyQt4,StringIO,apt,cStringIO,celery,colorlog,commands,cups,dateutil,django,django_filters,dns,ipaddr,lazy_object_proxy,ldap,ldif,listener,magic,mock,netifaces,notifier,psutil,pycurl,pytest,requests,rest_framework,ruamel,samba,sip,six,smbpasswd,urllib3,urlparse,utils,wakeonlan"
line_length = 105
multi_line_output = 3
include_trailing_comma = true
profile="black"
skip_glob = "venv/*"