Skip to content

Commit 05bd583

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

3 files changed

Lines changed: 80 additions & 80 deletions

File tree

.pre-commit-config.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,16 @@ repos:
3131
rev: v1.0.1
3232
- hooks:
3333
- id: ruff
34-
args: [--fix]
34+
args: [--fix, --config, ruff.toml]
3535
- id: ruff-format
36+
args: [--config, ruff.toml]
3637
repo: https://github.com/astral-sh/ruff-pre-commit
3738
rev: v0.6.1
3839
- repo: https://github.com/RobertCraigie/pyright-python
3940
rev: v1.1.380
4041
hooks:
4142
- id: pyright
43+
args: [--project, .]
4244
types: [python]
4345
- repo: https://github.com/netromdk/vermin
4446
rev: v1.6.0

pyproject.toml

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -79,85 +79,6 @@ asyncio_mode = "auto"
7979
junit_family = "xunit1"
8080
testpaths = ["tests"]
8181

82-
[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
118-
target-version = "py310"
119-
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-
16182
[tool.setuptools.packages.find]
16283
where = ["src"]
16384

ruff.toml

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