forked from e-valuation/EvaP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
114 lines (92 loc) · 3.84 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
[project]
requires-python = ">=3.10"
##############################################
[tool.black]
line-length = 120
include = 'evap.*\.pyi?$'
extend-exclude = """\
.*/urls\\.py|\
.*/migrations/.*\
"""
##############################################
[tool.isort]
profile = "black"
src_paths = ["evap"]
line_length = 120
skip_gitignore = true
extend_skip_glob = ["**/migrations/*"]
##############################################
[tool.pylint.master]
jobs = 0
load-plugins = ["pylint_django"]
django-settings-module = "evap.settings"
[tool.pylint.basic]
# For most code: snake_case, or PascalCaseFormset, because django does it that way.
# see https://docs.djangoproject.com/en/4.0/topics/forms/formsets/
# For migrations, models are assigned as local variables. Until pylint supports configuration-per-directory, we also
# need to allow that here (their issue 618)
variable-rgx = "(^[a-z0-9_]+$)|(^[A-Za-z]+$)"
argument-rgx = "(^[a-z0-9_]+$)|(^[A-Za-z]+$)"
method-rgx = "(^[a-z0-9_]+$)|(^assert[A-Za-z]+$)"
# Allow 4 leading digits for migrations
module-rgx = "^([0-9]{4})?([a-z_][a-z0-9_]+)$"
good-names = [ "i", "j", "k", "ex", "Run", "_", "__", "e", "logger", "setUpTestData", "setUp", "tearDown"]
[tool.pylint.format]
expected-line-ending-format = "LF"
[tool.pylint.messages_control]
enable = ["all"]
disable = [
"locally-disabled", # we allow locally disabling some checks if we think it makes sense to do that.
"suppressed-message",
"line-too-long", # black does code formatting for us
"ungrouped-imports", # isort
"wrong-import-order", # isort
"too-many-public-methods", # reported for some models, that won't change
"too-few-public-methods", # noisy, e.g. exception classes, mixins etc
"no-member", # false positives, deals badly with django classes
"logging-format-interpolation", # decided against the proposed change in favor of .format()
"too-many-ancestors", # noisy, reported for all test classes
"missing-docstring", # yeah... we don't have those
"protected-access", # for us that means "be careful", not "don't do it"
"too-many-lines", # we don't currently think that splitting up views.py or test_views.py creates any value
"too-many-arguments", # we can't determine a good limit here. reviews should spot bad cases of this.
"duplicate-code", # Mostly imports and test setup.
"cyclic-import", # We use these inside methods that require models from multiple apps. Tests will catch actual errors.
"unsupported-binary-operation", # broken in pylint 2.15: https://github.com/PyCQA/pylint/issues/7381
]
##############################################
[tool.coverage.run]
branch = true
omit = ["*migrations*", "*__init__.py"]
source = ["evap"]
[tool.coverage.report]
omit = ["*/migrations/*", "*__init__.py"]
##############################################
[tool.mypy]
plugins = ["mypy_django_plugin.main"]
exclude = 'evap/.*/migrations/.*\.py$'
no_implicit_optional = true
[tool.django-stubs]
django_settings_module = "evap.settings"
[[tool.mypy.overrides]]
module = [
"django_fsm.*",
"django_sendfile.*",
"django_webtest.*",
"debug_toolbar.*",
"mozilla_django_oidc.*",
"model_bakery.*",
"xlrd.*",
"xlwt.*",
"evap.staff.fixtures.*",
]
ignore_missing_imports = true
##############################################
[tool.pytest.ini_options]
# We don't officially use pytest, but last time we wanted to, this worked for us with pytest-django
# pytest-xdist worked for parallelizing tests.
DJANGO_SETTINGS_MODULE = "evap.settings"
python_files = ["tests.py", "test_*.py", "*_tests.py"]
testpaths = ["evap"]
norecursedirs=["locale", "logs", "static", "static_collected", "upload"]
addopts = "--reuse-db"