-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpyproject.toml
162 lines (144 loc) · 6.15 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
[tool.ruff]
# ruff 0.0.246
external = ["W601", "F812", "E403", "E704"]
line-length = 180
ignore-init-module-imports = true
select = ["ALL"]
ignore = [
"E501", # ignore line length
"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
"B020", # allow loop-variable-overrides-iterator
"BLE001", # allow catching Exception (blind-except)
"PLR0913", # too-many-args
"PLR0915", # too-many-statements
"PLR0911", # too-many-return-statements
"PLR0912", # too-many-branches
# 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
"PIE810", # single-starts-ends-with
# F401: not py2 compat because of "typing" type hint comments: https://github.com/charliermarsh/ruff/issues/1619
# would be nice but no autofix available
"B007", # unused-loop-control-variable
"TID252", # relative-imports
"B904", # allow raise-without-from-inside-except → too many violations
"C417", # unnecessary-map
"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/charliermarsh/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"
"SIM118", # unsure if everything is a dict, let's select each individually somewhen
# issues in ruff:
"PYI001", # https://github.com/charliermarsh/ruff/issues/2736
"SIM114", # https://github.com/charliermarsh/ruff/issues/2848
"PIE804", # no-unnecessary-dict-kwargs https://github.com/charliermarsh/ruff/issues/2387
"RUF100", # https://github.com/charliermarsh/ruff/issues/2406, https://github.com/charliermarsh/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 = ["’", "`", "´"]
target-version = "py37"
extend-exclude = [
"services/univention-ldb-modules/buildtools/wafsamba/",
"doc/developer-reference/",
"oidc/python-keycloak",
"packaging/ucslint/testframework/",
]
task-tags = ["TODO", "FIXME"]
[tool.ruff.flake8-builtins]
builtins-ignorelist = ["copyright", "license", "object", "exit", "quit", "credits"]
[tool.ruff.mccabe]
max-complexity = 134
[tool.ruff.flake8-quotes]
docstring-quotes = "double"
multiline-quotes = "double"
inline-quotes = "single"
[tool.ruff.flake8-unused-arguments]
ignore-variadic-names = true
[tool.ruff.flake8-pytest-style]
parametrize-names-type = "csv"
[tool.ruff.flake8-annotations]
ignore-fully-untyped = true
[tool.ruff.isort]
combine-as-imports = true
#filter-files = true
#force-grid-wrap = false
known-first-party = ["univention", "stub_udm_client"]
known-third-party = ["dateutil", "debian", "fastapi", "ldap", "pytest", "requests", "sqlalchemy", "starlette", "tornado"]
known-local-folder = ["app", "portal_consumer", "pages"]
# https://github.com/charliermarsh/ruff/issues/2600 :
#multi-line-output = 5
#include-trailing-comma = true
lines-after-imports = 2