forked from WeblateOrg/weblate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
118 lines (111 loc) · 4.67 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
[build-system]
# Minimum requirements for the build system to execute.
requires = ["setuptools", "wheel", "translate-toolkit"] # PEP 508 specifications.
[tool.black]
target-version = ['py39']
[tool.codespell]
skip = '*.po,*.pot,*.json,*.tmx,*.tbx,yarn.lock,known_hosts'
[tool.pylint.main]
disable = [
"C",
"W",
"R",
"I",
"no-member",
"not-a-mapping",
"unsubscriptable-object",
"unsupported-membership-test",
"not-an-iterable",
"unsupported-binary-operation",
"c-extension-no-member",
"not-callable",
"invalid-str-returned",
"raising-bad-type",
"no-name-in-module",
"import-error"
]
extension-pkg-whitelist = ["siphashc"]
ignore = [
"migrations",
"settings.py",
"settings_test.py",
".git",
"test-repos",
"repos",
"build",
".venv"
]
[tool.ruff]
# CONFIG - intentional configuration
# TODO - needs decision whether intention, add noqa tags or fix
# WONTFIX - not fixable in current codebase, might be better to go for noqa
ignore = [
"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
"EM", # TODO: Exception strings
"PTH", # TODO: Not using pathlib
"FBT", # TODO: Boolean in function definition
"BLE001", # WONTFIX: Do not catch blind exception: `Exception`, third-party modules do not have defined exceptions
"ARG001", # TODO: Unused function argument (mostly for API compatibility)
"ARG002", # TODO: Unused method argument (mostly for API compatibility)
"ANN", # TODO: we are missing many annotations
"D10", # TODO: we are missing many docstrings
"D401", # TODO: many strings need rephrasing
"TRY003", # WONTFIX: Avoid specifying long messages outside the exception class
"TRY200", # TODO: Use `raise from` to specify exception cause
"B904", # TODO: Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling
"PERF203", # WONTFIX: This rule is only enforced for Python versions prior to 3.1
"PLR0911", # WONTFIX: Too many return statements
"PLR0912", # WONTFIX: Too many branches
"PLR0913", # WONTFIX: Too many arguments to function call
"PLR0915", # WONTFIX: Too many statements
"PLR2004", # TODO: Magic value used in comparison, consider replacing 201 with a constant variable
"RUF001", # WONTFIX: String contains ambiguous unicode character, we are using Unicode
"RUF012", # TODO: Mutable class attributes should be annotated with `typing.ClassVar`
"RUF100", # TODO: unused noqa, compatibility with flake8, can be dropped once we stop using it
"E501", # WONTFIX: we accept long strings (rest is formatted by black)
"PLW2901", # TODO: overwriting variables inside loop
"A001", # TODO: overriding builtins (might need noqa tags)
"A002", # TODO: overriding builtins (might need noqa tags)
"A003", # TODO: overriding builtins (might need noqa tags)
"SLF001" # TODO: Private member accessed (might need noqa tags)
]
output-format = "github"
select = ["ALL"]
target-version = "py39"
[tool.ruff.isort]
split-on-trailing-comma = false
[tool.ruff.mccabe]
max-complexity = 16
[tool.ruff.per-file-ignores]
"docs/_ext/djangodocs.py" = ["INP001"]
"docs/conf.py" = ["INP001", "ERA001", "A001"]
"scripts/*" = ["T201", "T203"]
"weblate/*/management/commands/*.py" = ["A003"] # Needed by Django API
"weblate/*/migrations/*.py" = ["C405", "E501", "N806", "DJ01"]
"weblate/*/tests.py" = ["S106", "S105"]
"weblate/*/tests/test_*.py" = ["S106", "S105"]
"weblate/addons/management/commands/list_addons.py" = ["E501"]
"weblate/addons/utils.py" = ["N806"]
"weblate/auth/migrations/0018_fixup_role.py" = ["T201", "N806"]
"weblate/examples/*.py" = ["INP001"]
"weblate/lang/data.py" = ["E501"]
"weblate/machinery/management/commands/list_machinery.py" = ["E501"]
"weblate/settings_*.py" = ["F405"]
"weblate/settings_docker.py" = ["ERA001"]
"weblate/settings_example.py" = ["ERA001"]
"weblate/trans/migrations/0103_update_source_unit.py" = ["T201", "N806"]
"weblate/trans/migrations/0116_migrate_glossaries.py" = ["T201", "N806", "E501"]
"weblate/trans/migrations/0127_fix_source_glossary.py" = ["T201", "N806"]
"weblate/trans/migrations/0133_glossary_missing_files.py" = ["T201", "N806"]
"weblate/trans/tests/test_files.py" = ["E501"]
"weblate/utils/generate_secret_key.py" = ["T201"]
"weblate/utils/licensedata.py" = ["E501"]
"weblate/utils/locale.py" = ["B012"]