Skip to content

Commit 61d75f5

Browse files
committed
feat: add .ruff.toml for the template itself
1 parent c85b2a6 commit 61d75f5

File tree

1 file changed

+132
-0
lines changed

1 file changed

+132
-0
lines changed

.ruff.toml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
2+
# Exclude a variety of commonly ignored directories.
3+
# Most importantly, don't lint the inner jinja affected files.
4+
exclude = [
5+
".bzr",
6+
".direnv",
7+
".eggs",
8+
".git",
9+
".git-rewrite",
10+
".hg",
11+
".ipynb_checkpoints",
12+
".mypy_cache",
13+
".nox",
14+
".pants.d",
15+
".pyenv",
16+
".pytest_cache",
17+
".pytype",
18+
".ruff_cache",
19+
".svn",
20+
".tox",
21+
".venv",
22+
".vscode",
23+
"__pypackages__",
24+
"_build",
25+
"buck-out",
26+
"build",
27+
"dist",
28+
"node_modules",
29+
"site-packages",
30+
"venv",
31+
"{{cookiecutter.project_name}}",
32+
]
33+
34+
# Same as Black.
35+
line-length = 120
36+
indent-width = 4
37+
38+
# Assume Python 3.9
39+
target-version = "py39"
40+
41+
[lint]
42+
# https://docs.astral.sh/ruff/rules
43+
select = [
44+
"A",
45+
"ARG",
46+
"B",
47+
"B9",
48+
"BLE",
49+
"C",
50+
"C4",
51+
"D",
52+
"DTZ",
53+
"E",
54+
"F",
55+
"I",
56+
"N",
57+
"PT",
58+
"PTH",
59+
"Q",
60+
"RET",
61+
"RUF",
62+
"S",
63+
"SIM",
64+
"SLF",
65+
"T10",
66+
"TC",
67+
"W"
68+
]
69+
ignore = ["E203", "E501"]
70+
71+
72+
# Allow fix for all enabled rules (when `--fix`) is provided.
73+
fixable = ["ALL"]
74+
unfixable = []
75+
76+
# Allow unused variables when underscore-prefixed.
77+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
78+
79+
[lint.flake8-quotes]
80+
inline-quotes = "double"
81+
82+
[lint.isort]
83+
force-single-line = true
84+
lines-after-imports = 2
85+
86+
[lint.mccabe]
87+
max-complexity = 10
88+
89+
[lint.per-file-ignores]
90+
"tests/*" = [
91+
"S101",
92+
"D100",
93+
"D101",
94+
"D102",
95+
"D103",
96+
"D104",
97+
"ARG001",
98+
"C408",
99+
"SLF001"
100+
]
101+
"exceptions.py" = ["D107"]
102+
"noxfile.py" = ["S101"]
103+
104+
[lint.pydocstyle]
105+
convention = "google"
106+
107+
[format]
108+
# Like Black, use double quotes for strings.
109+
quote-style = "double"
110+
111+
# Like Black, indent with spaces, rather than tabs.
112+
indent-style = "space"
113+
114+
# Like Black, respect magic trailing commas.
115+
skip-magic-trailing-comma = false
116+
117+
# Like Black, automatically detect the appropriate line ending.
118+
line-ending = "auto"
119+
120+
# Enable auto-formatting of code examples in docstrings. Markdown,
121+
# reStructuredText code/literal blocks and doctests are all supported.
122+
#
123+
# This is currently disabled by default, but it is planned for this
124+
# to be opt-out in the future.
125+
docstring-code-format = false
126+
127+
# Set the line length limit used when formatting code snippets in
128+
# docstrings.
129+
#
130+
# This only has an effect when the `docstring-code-format` setting is
131+
# enabled.
132+
docstring-code-line-length = "dynamic"

0 commit comments

Comments
 (0)