Skip to content

Commit 9cd6a59

Browse files
author
Вадим Козыревский
committed
Add ruff settings
1 parent 6d2e5d7 commit 9cd6a59

1 file changed

Lines changed: 77 additions & 0 deletions

File tree

pyproject.toml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,84 @@ junit_family = "xunit1"
8080
testpaths = ["tests"]
8181

8282
[tool.ruff]
83+
# Exclude a variety of commonly ignored directories.
84+
exclude = [
85+
".bzr",
86+
".direnv",
87+
".eggs",
88+
".git",
89+
".git-rewrite",
90+
".hg",
91+
".ipynb_checkpoints",
92+
".mypy_cache",
93+
".nox",
94+
".pants.d",
95+
".pyenv",
96+
".pytest_cache",
97+
".pytype",
98+
".ruff_cache",
99+
".svn",
100+
".tox",
101+
".venv",
102+
".vscode",
103+
"__pypackages__",
104+
"_build",
105+
"buck-out",
106+
"build",
107+
"dist",
108+
"node_modules",
109+
"site-packages",
110+
"venv",
111+
]
112+
113+
# Same as Black.
114+
line-length = 120
115+
indent-width = 4
116+
117+
# Assume Python 3.10
83118
target-version = "py310"
84119

120+
[tool.ruff.lint]
121+
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
122+
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
123+
# McCabe complexity (`C901`) by default.
124+
select = ["E4", "E7", "E9", "F"]
125+
ignore = []
126+
127+
# Allow fix for all enabled rules (when `--fix`) is provided.
128+
fixable = ["ALL"]
129+
unfixable = []
130+
131+
# Allow unused variables when underscore-prefixed.
132+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
133+
134+
[tool.ruff.format]
135+
# Like Black, use double quotes for strings.
136+
quote-style = "double"
137+
138+
# Like Black, indent with spaces, rather than tabs.
139+
indent-style = "space"
140+
141+
# Like Black, respect magic trailing commas.
142+
skip-magic-trailing-comma = false
143+
144+
# Like Black, automatically detect the appropriate line ending.
145+
line-ending = "auto"
146+
147+
# Enable auto-formatting of code examples in docstrings. Markdown,
148+
# reStructuredText code/literal blocks and doctests are all supported.
149+
#
150+
# This is currently disabled by default, but it is planned for this
151+
# to be opt-out in the future.
152+
docstring-code-format = false
153+
154+
# Set the line length limit used when formatting code snippets in
155+
# docstrings.
156+
#
157+
# This only has an effect when the `docstring-code-format` setting is
158+
# enabled.
159+
docstring-code-line-length = "dynamic"
160+
85161
[tool.setuptools.packages.find]
86162
where = ["src"]
163+

0 commit comments

Comments
 (0)