-
Notifications
You must be signed in to change notification settings - Fork 3
/
pyproject.toml
104 lines (94 loc) · 2.97 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
[tool.ruff]
lint.select = ["F", "E", "W", "C90", "I", "N", "D", "YTT", "ANN", "S", "BLE", "FBT", "B", "A", "C", "C4", "DTZ","T10","DJ",
"EM", "FA", "ISC", "ICN", "G", "INP", "PIE", "PYI", "Q", "RSE", "RET", "SLF", "SLOT", "SIM", "TID", "TCH", "INT",
"ARG", "PTH", "TD", "FIX", "ERA", "PD", "PL", "TRY", "FLY", "NPY", "AIR", "PERF", "LOG", "RUF"
]
lint.ignore = [
# Ruff formatter recommendations
"W19",
"E111",
"E114",
"E117",
"D206",
"D300",
"Q000",
"Q001",
"Q002",
"Q003",
"COM819",
"ISC001",
"ISC002",
# Napse specific
"PLR0913", # Less than 5 arguments
"D107", # Missing docstring in __init__
# "SLF001", # Private member accessed
# "D100", # Missing docstring in public module
# "D101", # Missing docstring in public class
# "D102", # Missing docstring in public method
# "D103", # Missing docstring in public function
# "D105", # Missing docstring in magic method
# "D106", # Missing docstring in public nested class
# "A003", # attribute is shadowing a Python builtin
# "D203", # 1 blank line required before class docstring
# "D213", # Multi-line docstring summary should start at the first line
# "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
# "RUF100", # For transition with workflow
# Deprecated
"ANN101",
"ANN102",
# Other
"D105",
# "N802", # Function name `...` should be lowercase
"D100", # Module documentation
]
# Allow autofix for all enabled rules (when `--fix`) is provided
lint.fixable = ["ALL"]
lint.unfixable = []
# Exclude a variety of commonly ignored directories.
lint.exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
".venv",
"migrations",
]
# Same as Black.
line-length = 150
indent-width = 4
# Allow unused variables when underscore-prefixed.
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
lint.pydocstyle.convention ="google"
lint.mccabe.max-complexity = 15
# Assume Python 3.11.
target-version = "py311"
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "F403", "D104"] # Imports in __init__
"django_napse/core/settings.py" = ["N802"] # lowercase function name
"tests/django_tests/*" = [
"D101", "D102", # Method docstring
"ANN", # Type annotations
"ERA001", # Found commented-out code
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true
docstring-code-line-length = "dynamic"
line-ending = "lf"