@@ -18,10 +18,11 @@ pytest-cov = "^5.0.0"
18
18
pytest-django = " ^4.8.0"
19
19
20
20
[tool .poetry .dev-dependencies ]
21
- black = " ^24.3.0"
22
- isort = " ^5.13.2"
23
21
pre-commit = " ^3.7.0"
24
22
django-stubs = " ^4.2.7"
23
+ {%- if cookiecutter.linter == 'Flake8' %}
24
+ isort = " ^5.13.2"
25
+ black = " ^24.3.0"
25
26
flake8 = " ^7.0.0"
26
27
flake8-bandit = " ^4.1.1"
27
28
flake8-broken-line = " ^1.0.0"
@@ -35,10 +36,14 @@ flake8-string-format = "^0.3.0"
35
36
flake8-pyproject = " ^1.2.3"
36
37
flake8-bugbear = " ^24.2.6"
37
38
flake8-rst-docstrings = " ^0.3.0"
39
+ {%- endif %}
40
+ {%- if cookiecutter.linter == 'Ruff' %}
41
+ ruff = " ^0.5.7"
38
42
mypy = " ^1.9.0"
39
43
pylint = " ^3.1.0"
40
44
safety = " ^3.1.0"
41
45
46
+ {%- if cookiecutter.linter == 'Flake8' %}
42
47
[tool .black ]
43
48
line-length = 100
44
49
target-version = [' py312' ]
@@ -66,6 +71,7 @@ known_django = "django"
66
71
profile = " django"
67
72
src_paths = " app"
68
73
lines_after_imports = 2
74
+ {%- endif %}
69
75
70
76
[build-system ]
71
77
requires = [" poetry-core>=1.0.0" ]
@@ -92,6 +98,7 @@ plugins = "mypy_django_plugin.main"
92
98
[tool .django-stubs ]
93
99
django_settings_module = " app.settings.base"
94
100
101
+ {%- if cookiecutter.linter == 'Flake8' %}
95
102
[tool .flake8 ]
96
103
ignore = [
97
104
" C812" , # missing trailing comma
@@ -184,6 +191,7 @@ max-complexity = 15
184
191
max-name-length = 60
185
192
max-line-length = 100
186
193
count = true
194
+ {%- endif %}
187
195
188
196
189
197
[tool .pylint .main ]
@@ -267,3 +275,54 @@ ignored-classes = [
267
275
" _thread._local" ,
268
276
" argparse.Namespace" ,
269
277
]
278
+
279
+
280
+ {%- if cookiecutter.linter == 'Ruff' %}
281
+ [tool .ruff ]
282
+ src = [" {{cookiecutter.project_name}}" ]
283
+ line-length = 99
284
+ unsafe-fixes = true
285
+ extend-exclude = [
286
+ " docs/*" ,
287
+ " .venv" ,
288
+ " venv" ,
289
+ ]
290
+
291
+ [tool .ruff .lint ]
292
+ select = [" ALL" ]
293
+ ignore = [
294
+ " COM812" , # Trailing comma missing
295
+ " D100" , # Missing docstring in public module
296
+ " D101" , # Missing docstring in public class
297
+ " D102" , # Missing docstring in public method
298
+ " D103" , # Missing docstring in public function
299
+ " D104" , # Missing docstring in public package
300
+ " D105" , # Missing docstring in magic method
301
+ " D106" , # Missing docstring in public nested class
302
+ " D107" , # Missing docstring in __init__
303
+ " FBT001" , # Boolean-typed positional argument in function definition
304
+ " FBT002" , # Boolean default positional argument in function definition
305
+ " N818" , # Exception name should be named with Error suffix
306
+ " PT004" , # Deprecated error, will be removed in future release
307
+ ]
308
+
309
+ [tool .ruff .lint .per-file-ignores ]
310
+ "tests/*" = [
311
+ " S101" , # Use of assert detected
312
+ " S106" , # Possible hardcoded password assigned to argument
313
+ ]
314
+
315
+ [tool .ruff .lint .isort ]
316
+ lines-after-imports = 2
317
+
318
+ [tool .ruff .lint .pylint ]
319
+ max-args = 12
320
+ max-public-methods = 10
321
+ max-locals = 16
322
+
323
+ [tool .ruff .lint .mccabe ]
324
+ max-complexity = 10
325
+
326
+ [tool .ruff .lint .pydocstyle ]
327
+ convention = " google"
328
+ {%- endif %}
0 commit comments