-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
148 lines (126 loc) · 3.38 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# ==== pytest ====
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--ds=config.settings.test --reuse-db"
python_files = [
"tests.py",
"test_*.py",
]
# ==== Coverage ====
[tool.coverage.run]
include = ["sedos_dashboard/**"]
omit = ["*/migrations/*", "*/tests/*"]
plugins = ["django_coverage_plugin"]
# ==== black ====
[tool.black]
line-length = 119
target-version = ['py311']
# ==== isort ====
[tool.isort]
profile = "black"
line_length = 119
known_first_party = [
"sedos_dashboard",
"config",
]
skip = ["venv/"]
skip_glob = ["**/migrations/*.py"]
# ==== mypy ====
[tool.mypy]
python_version = "3.11"
check_untyped_defs = true
ignore_missing_imports = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_unused_configs = true
plugins = [
"mypy_django_plugin.main",
"mypy_drf_plugin.main",
]
[[tool.mypy.overrides]]
# Django migrations should not produce any errors:
module = "*.migrations.*"
ignore_errors = true
[tool.django-stubs]
django_settings_module = "config.settings.test"
# ==== PyLint ====
[tool.pylint.MASTER]
load-plugins = [
"pylint_django",
"pylint_celery",
]
django-settings-module = "config.settings.local"
[tool.pylint.FORMAT]
max-line-length = 119
[tool.pylint."MESSAGES CONTROL"]
disable = [
"missing-docstring",
"invalid-name",
]
[tool.pylint.DESIGN]
max-parents = 13
[tool.pylint.TYPECHECK]
generated-members = [
"REQUEST",
"acl_users",
"aq_parent",
"[a-zA-Z]+_set{1,2}",
"save",
"delete",
]
# ==== djLint ====
[tool.djlint]
blank_line_after_tag = "load,extends"
close_void_tags = true
format_css = true
format_js = true
# TODO: remove T002 when fixed https://github.com/Riverside-Healthcare/djLint/issues/687
ignore = "H006,H030,H031,T002"
include = "H017,H035"
indent = 2
max_line_length = 119
profile = "django"
[tool.djlint.css]
indent_size = 2
[tool.djlint.js]
indent_size = 2
# ==== ruff ====
[tool.ruff]
line-length = 119
select = ["ALL"]
exclude = [
"manage.py",
"config/wsgi.py",
"sedos_dashboard/contrib/*",
]
ignore = [
"I001", # Import block is un-sorted or un-formatted (done by isort)
"D203", # 1 blank line required before class docstring
"D212", # Multi-line docstring summary should start at the first line pydocstyle
"ANN101", # Missing type annotation for `self` in method
"ANN102", # Missing type annotation for `cls` in classmethod
"ANN003", # Missing type annotation for `**kwargs`
"EM102", # Exception must not use an f-string literal, assign to variable first
"TRY003", # Avoid specifying long messages outside the exception class
"S101", # Use of `assert` detected
"UP007", # Use `X | Y` for type annotations
"B905", # `zip()` without an explicit `strict=` parameter
"FIX001", # Line contains FIXME
"FIX002", # Line contains TODO
"RET504", # Unnecessary variable assignment before `return` statement
"G004", # Logging statement uses f-string
"PD011", # Use `.to_numpy()` instead of `.values` (does not work out of the box)
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"UP038", # (non-pep604-isinstance)
]
fix = true
show-fixes = true
unfixable = ["UP007", "I001"]
[tool.ruff.per-file-ignores]
"tests/*" = [
"PLR2004", # Magic value used in comparison
"ANN201", # Missing return type annotation for public function
]
"*/__init__.py" = [
"D104", # Missing docstring in public package
]