mirror of
https://gh.wpcy.net/https://github.com/WeblateOrg/weblate.git
synced 2026-04-25 23:57:21 +08:00
122 lines
4.8 KiB
TOML
122 lines
4.8 KiB
TOML
[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
|
|
"D206", # CONFIG: formatter
|
|
'ISC001', # CONFIG: formatter
|
|
'Q000', # CONFIG: formatter
|
|
'Q001', # CONFIG: formatter
|
|
'Q002', # CONFIG: formatter
|
|
'Q003', # CONFIG: formatter
|
|
'W191', # CONFIG: formatter
|
|
"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.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"]
|