-
Notifications
You must be signed in to change notification settings - Fork 3
/
pyproject.toml
93 lines (83 loc) · 2.44 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
[build-system]
requires = [
"setuptools >= 42",
"wheel",
]
build-backend = "setuptools.build_meta"
[tool.black]
line-length = 99
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''
[tool.bandit]
skips = ["B101", "B404"]
github_url = "https://github.com/Amsterdam/schema-tools"
[tool.ruff]
line-length = 99
target-version = "py39"
[tool.ruff.lint]
select = [
"F", # pyflakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
"I", # isort
"B", # flake8-bugbear
"C90", # mccabe
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
"DJ", # flake8-django
"ISC", # flake8-implicit-str-concat
"G", # flake8-logging-format
"PIE", # flake8-pie
"PGH", # pygrep-hooks
"RET", # flake8-return (partially)
# "PT", # flake8-pytest-style
# "TCH", # flake8-type-checking (moves import to `if typing.TYPE_CHECKING`)
# "ERA", # eradicate (commented out code)
# "TRY", # tryceratops
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"INT", # flake8-gettext
"FLY", # flynt (fixes unneeded static string joins)
"UP", # pyupgrade
"S", # security (bugbear)
"RUF010", # ruff: fix f"{str(..)}" usage
"RUF013", # ruff: fix annotations for =None arguments
]
ignore = [
"S311", # allow random.randint()
"DJ001", # allow models.CharField(null=True)
"SIM105", # enforcing contextlib.suppress() instead of try..catch
"RET501", # unnecessary-return-none
"RET505", # superfluous-else-return
"RET505", # superfluous-else-return
"RET506", # superfluous-else-raise
"RET507", # superfluous-else-continue
"RET508", # superfluous-else-break
"S607", # subprocess partial path
]
[tool.ruff.lint.flake8-comprehensions]
allow-dict-calls-with-keyword-arguments = true
[tool.ruff.lint.flake8-gettext]
extend-function-names = ["gettext_lazy", "ngettext_lazy", "pgettext", "pgettext_lazy", "npgettext", "npgettext_lazy"]
[tool.ruff.lint.isort]
known-first-party = ["schematools"]
required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.mccabe]
max-complexity = 20 # TODO: lower this
[tool.ruff.lint.per-file-ignores]
"**/migrations/*.py" = ["E501"] # line too long
"tests/**/*.py" = ["E501", "S101", "S105", "S106", "S314", "S608"] # allow long lines, asserts, hardcoded passwords, SQL injection