-
-
Notifications
You must be signed in to change notification settings - Fork 55
/
pyproject.toml
130 lines (119 loc) · 4.32 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
[tool.black]
target-version = ['py311']
[tool.django-stubs]
django_settings_module = "weblate_web.settings"
# strict_settings = false
[tool.djlint]
blank_line_after_tag = "load,extends,endblock"
# H014 - Found extra blank lines.
# T003 - Endblock should have name.
# H013 - Img tag should have an alt attribute.
# H006 - Img tag should have height and width attributes.
ignore = "T003,H014,H013,H006"
indent = 2
max_attribute_length = 80
max_blank_lines = 2
preserve_blank_lines = true
profile = "django"
[tool.djlint.per-file-ignores]
"weblate_web/invoices/templates/invoice-template.html" = "H031"
"weblate_web/legal/templates/pdf/base.html" = "H030,H031"
# False positives for crypto URLs
"weblate_web/templates/donate.html" = "D018"
# Use language-less URLs in notifications
"weblate_web/templates/mail/base.html" = "H030,D018,H021,H031"
"weblate_web/templates/mail/payment_completed.html" = "D018"
"weblate_web/templates/mail/payment_expired.html" = "D018"
"weblate_web/templates/mail/payment_failed.html" = "D018"
"weblate_web/templates/mail/payment_missing.html" = "D018"
"weblate_web/templates/mail/payment_upcoming.html" = "D018"
"weblate_web/templates/mail/subscription_intro.html" = "D018"
[tool.isort]
profile = "black"
[tool.mypy]
check_untyped_defs = true
plugins = [
"mypy_django_plugin.main",
"mypy_drf_plugin.main"
]
[[tool.mypy.overrides]]
disallow_untyped_defs = true
ignore_missing_imports = true
module = [
"qrcode.*",
"saml2.*",
"vies.*",
"wlc.*",
"fiobank.*",
"weblate_language_data.*",
"appconf.*",
"zammad_py.*",
"markupfield.*",
"weasyprint.*"
]
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "weblate_web.settings"
addopts = "--reuse-db --cov=weblate_web --cov-report="
python_files = ["test_*.py", "tests.py"]
[tool.ruff]
target-version = "py311"
[tool.ruff.lint]
extend-safe-fixes = [
"D",
"TCH",
"FLY",
"SIM",
"ANN",
"FA102",
"UP"
]
ignore = [
"CPY001", # TODO
"FBT", # TODO: Boolean in function definition
"ICN001", # CONFIG: no aliased imports
"COM", # CONFIG: No trailing commas
"PT", # CONFIG: Not using pytest
"D203", # CONFIG: incompatible with D211
"D212", # CONFIG: incompatible with D213
"FIX002", # CONFIG: we use TODO
"TD002", # CONFIG: no detailed TODO documentation is required
"TD003", # CONFIG: no detailed TODO documentation is required
"S603", # CONFIG: `subprocess` call: check for execution of untrusted input
"S607", # CONFIG: executing system installed tools
"D206", # CONFIG: formatter
'ISC001', # CONFIG: formatter
'Q000', # CONFIG: formatter
'Q001', # CONFIG: formatter
'Q002', # CONFIG: formatter
'Q003', # CONFIG: formatter
'W191', # CONFIG: formatter
"ANN", # TODO: we are missing many annotations
"ARG001", # TODO: Unused function argument (mostly for API compatibility)
"ARG002", # TODO: Unused method argument (mostly for API compatibility)
"PTH", # TODO: Not using pathlib
"BLE001", # WONTFIX: Do not catch blind exception: `Exception`, third-party modules do not have defined exceptions
"EM", # TODO: Exception strings
"D10", # TODO: we are missing many docstrings
"DJ001", # TODO: Avoid using `null=True` on string-based fields such as CharField (maybe add noqa)
"DOC", # TODO: pydoclint violations
"TRY003", # WONTFIX: Avoid specifying long messages outside the exception class
"PLR0912", # WONTFIX: Too many branches
"PLR6301", # TODO: Method could be a function, class method, or static method
"PLR2004", # TODO: Magic value used in comparison, consider replacing 201 with a constant variable
"PLR0904", # TODO: Too many public methods
"RUF001", # WONTFIX: String contains ambiguous unicode character, we are using Unicode
"RUF012", # TODO: Mutable class attributes should be annotated with `typing.ClassVar`
"E501", # WONTFIX: we accept long strings (rest is formatted by black)
"PLW1514", # TODO: `open` in text mode without explicit `encoding` argument
"N818", # TODO: exception naming
"FURB113", # TODO: Use `image.extend(...)` instead of repeatedly calling `image.append()`
"SLF001" # TODO: Private member accessed (might need noqa tags)
]
preview = true
select = ["ALL"]
[tool.ruff.lint.mccabe]
max-complexity = 16
[tool.ruff.lint.per-file-ignores]
"scripts/*" = ["T201"]
"weblate_web/migrations/0031_fill_in_customer.py" = ["T201"]
"weblate_web/payments/backends.py" = ["T201"]