@@ -17,11 +17,12 @@ pytest = "^8.1.1"
17
17
pytest-cov = " ^5.0.0"
18
18
pytest-django = " ^4.8.0"
19
19
20
- [tool .poetry .group .dev .dependencies ]
21
- black = " ^24.3.0"
22
- isort = " ^5.13.2"
20
+ [tool .poetry .dev-dependencies ]
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,13 +36,17 @@ 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
pytest-randomly = " ^3.15.0"
42
46
faker = " ^28.4.1"
43
47
factory-boy = " ^3.3.1"
44
48
49
+ {%- if cookiecutter.linter == 'Flake8' %}
45
50
[tool .black ]
46
51
line-length = 100
47
52
target-version = [' py312' ]
@@ -69,6 +74,7 @@ known_django = "django"
69
74
profile = " django"
70
75
src_paths = " app"
71
76
lines_after_imports = 2
77
+ {%- endif %}
72
78
73
79
[build-system ]
74
80
requires = [" poetry-core>=1.0.0" ]
@@ -95,6 +101,7 @@ plugins = "mypy_django_plugin.main"
95
101
[tool .django-stubs ]
96
102
django_settings_module = " app.settings.base"
97
103
104
+ {%- if cookiecutter.linter == 'Flake8' %}
98
105
[tool .flake8 ]
99
106
ignore = [
100
107
" C812" , # missing trailing comma
@@ -187,6 +194,7 @@ max-complexity = 15
187
194
max-name-length = 60
188
195
max-line-length = 100
189
196
count = true
197
+ {%- endif %}
190
198
191
199
192
200
[tool .pylint .main ]
@@ -270,3 +278,54 @@ ignored-classes = [
270
278
" _thread._local" ,
271
279
" argparse.Namespace" ,
272
280
]
281
+
282
+
283
+ {%- if cookiecutter.linter == 'Ruff' %}
284
+ [tool .ruff ]
285
+ src = [" {{cookiecutter.project_name}}" ]
286
+ line-length = 99
287
+ unsafe-fixes = true
288
+ extend-exclude = [
289
+ " docs/*" ,
290
+ " .venv" ,
291
+ " venv" ,
292
+ ]
293
+
294
+ [tool .ruff .lint ]
295
+ select = [" ALL" ]
296
+ ignore = [
297
+ " COM812" , # Trailing comma missing
298
+ " D100" , # Missing docstring in public module
299
+ " D101" , # Missing docstring in public class
300
+ " D102" , # Missing docstring in public method
301
+ " D103" , # Missing docstring in public function
302
+ " D104" , # Missing docstring in public package
303
+ " D105" , # Missing docstring in magic method
304
+ " D106" , # Missing docstring in public nested class
305
+ " D107" , # Missing docstring in __init__
306
+ " FBT001" , # Boolean-typed positional argument in function definition
307
+ " FBT002" , # Boolean default positional argument in function definition
308
+ " N818" , # Exception name should be named with Error suffix
309
+ " PT004" , # Deprecated error, will be removed in future release
310
+ ]
311
+
312
+ [tool .ruff .lint .per-file-ignores ]
313
+ "tests/*" = [
314
+ " S101" , # Use of assert detected
315
+ " S106" , # Possible hardcoded password assigned to argument
316
+ ]
317
+
318
+ [tool .ruff .lint .isort ]
319
+ lines-after-imports = 2
320
+
321
+ [tool .ruff .lint .pylint ]
322
+ max-args = 12
323
+ max-public-methods = 10
324
+ max-locals = 16
325
+
326
+ [tool .ruff .lint .mccabe ]
327
+ max-complexity = 10
328
+
329
+ [tool .ruff .lint .pydocstyle ]
330
+ convention = " google"
331
+ {%- endif %}
0 commit comments