Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Commit 3ebefba

Browse files
code linting and formatting config file for project
1 parent f18fe30 commit 3ebefba

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
[tool.ruff]
2+
# Exclude a variety of commonly ignored directories.
3+
exclude = [
4+
".bzr",
5+
".direnv",
6+
".eggs",
7+
".git",
8+
".git-rewrite",
9+
".hg",
10+
".ipynb_checkpoints",
11+
".mypy_cache",
12+
".nox",
13+
".pants.d",
14+
".pyenv",
15+
".pytest_cache",
16+
".pytype",
17+
".ruff_cache",
18+
".svn",
19+
".tox",
20+
".venv",
21+
".vscode",
22+
"__pypackages__",
23+
"_build",
24+
"buck-out",
25+
"build",
26+
"dist",
27+
"node_modules",
28+
"site-packages",
29+
"venv",
30+
]
31+
32+
# Same as Black.
33+
line-length = 88
34+
indent-width = 4
35+
36+
# Assume Python 3.10
37+
target-version = "py310"
38+
39+
[tool.ruff.lint]
40+
# Enable the isort rules.
41+
extend-select = ["I"]
42+
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
43+
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
44+
# McCabe complexity (`C901`) by default.
45+
select = ["E4", "E7", "E9", "F"]
46+
ignore = []
47+
48+
# Allow fix for all enabled rules (when `--fix`) is provided.
49+
fixable = ["ALL"]
50+
unfixable = []
51+
52+
# Allow unused variables when underscore-prefixed.
53+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
54+
55+
[tool.ruff.format]
56+
# Like Black, use double quotes for strings.
57+
quote-style = "double"
58+
59+
# Like Black, indent with spaces, rather than tabs.
60+
indent-style = "tab"
61+
62+
# Like Black, respect magic trailing commas.
63+
skip-magic-trailing-comma = false
64+
65+
# Like Black, automatically detect the appropriate line ending.
66+
line-ending = "auto"
67+
68+
# Enable auto-formatting of code examples in docstrings. Markdown,
69+
# reStructuredText code/literal blocks and doctests are all supported.
70+
docstring-code-format = true
71+
72+
# Set the line length limit used when formatting code snippets in
73+
# docstrings.
74+
#
75+
# This only has an effect when the `docstring-code-format` setting is
76+
# enabled.
77+
docstring-code-line-length = "dynamic"

0 commit comments

Comments
 (0)