-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
105 lines (97 loc) · 2.34 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
[tool.bandit]
exclude_dirs = [
"mgallery/settings.py"
]
skips = ["B308"]
[tool.black]
line-length = 120
target_version = ["py312"]
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.pytest_cache
| \.venv
| _build
| build
| dist
)/
'''
[tool.curlylint.rules]
indent = 2
html_has_lang = true
[tool.ruff]
line-length = 120
indent-width = 4
target-version = "py312"
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # Pyflakes
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"S", # flake8-bandit
"A", # flake8-builtins
"DJ", # flake8-django
"I", # isort
"INP", # flake8-no-pep420
"RUF" # Ruff-specific rules
]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".mypy_cache",
".pytype",
".ruff_cache",
".venv",
"venv",
"__pypackages__",
"mgallery/settings.py"
]
ignore = [
# Disable eradicate (commented code removal)
"ERA001",
# Disable Conflicting lint rules,
# see https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191",
"E501",
"E111",
"E117",
"D206",
"D300",
"Q000",
"Q001",
"Q002",
"Q003",
"COM812",
"COM819",
"ISC001",
"ISC002",
"S603",
# Disable unused `noqa` directive
"RUF100",
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"N806", # Variable `CONSTANT_NAME` in function should be lowercase
"DJ001", # Avoid using `null=True` on string-based fields such as `CharField`
]
[tool.ruff.lint.pycodestyle]
ignore-overlong-task-comments = true
[tool.ruff.lint.isort]
section-order = ["future", "standard-library", "django", "third-party", "first-party", "local-folder"]
lines-after-imports = 2
[tool.ruff.lint.isort.sections]
# Group all Django imports into a separate section.
"django" = ["django"]
[tool.ruff.lint.per-file-ignores]
# Ignore "E402", "F403", "F405" (import violations) in __init__.py files.
# Ignore "S" (flake8-bandit) and "N802" (function name should be lowercase) in tests and docs.
# Ignore "RUF" (Ruff-specific rules) and "I" (isort) in migrations.
"__init__.py" = ["E402", "F403", "F405"]
"**/{tests,docs}/*" = ["E402", "F403", "F405", "S", "N802", "N815"]
"**/*test*.py" = ["E402", "F403", "F405", "S", "N802"]
"**/{settings}/*" = ["E402", "F403", "F405"]
"**/migrations/*" = ["RUF", "I"]