Skip to content

Commit 1dfb174

Browse files
committed
configure ruff
1 parent 2980f3f commit 1dfb174

File tree

1 file changed

+39
-9
lines changed

1 file changed

+39
-9
lines changed

pyproject.toml

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,42 @@ build-backend = "setuptools.build_meta"
55

66
[tool.ruff]
77
# Same as Black.
8-
line-length = 88
8+
line-length = 99
99
indent-width = 4
1010

1111
# Assume Python 3.8
1212
target-version = "py38"
1313

1414
[tool.ruff.lint]
15-
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
16-
select = ["E", "F", "W", "I", "UP", "S", "B", "T20", "RUF"]
15+
extend-select = [
16+
"F",
17+
"E",
18+
"W",
19+
"I",
20+
"UP",
21+
"YTT",
22+
"S",
23+
"BLE",
24+
"B",
25+
"A",
26+
# "CPY",
27+
"C4",
28+
"DTZ",
29+
"T10",
30+
# "EM",
31+
"EXE",
32+
"FA",
33+
"ISC",
34+
"ICN",
35+
"PT",
36+
"Q",
37+
]
1738
ignore = [
18-
"S101", # Use of assert detected
19-
"B905", # `zip()` without an explicit `strict=` parameter
39+
"S101", # Ignore use of assert for now
40+
"S105",
41+
"S311", # We are not using random for cryptographic purposes
42+
"ISC001",
43+
"S603",
2044
]
2145

2246
# Allow autofix for all enabled rules (when `--fix`) is provided.
@@ -51,11 +75,17 @@ exclude = [
5175
# Allow unused variables when underscore-prefixed.
5276
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
5377

78+
[tool.ruff.lint.flake8-quotes]
79+
inline-quotes = "single"
80+
81+
# [tool.ruff.lint.extend-per-file-ignores]
82+
# "*/test_*.py" = ["S101"]
83+
# "xcp_d/utils/debug.py" = ["A002", "T100"]
84+
# "docs/conf.py" = ["A001"]
85+
# "docs/sphinxext/github_link.py" = ["BLE001"]
86+
5487
[tool.ruff.format]
55-
quote-style = "double"
56-
indent-style = "space"
57-
skip-magic-trailing-comma = false
58-
line-ending = "auto"
88+
quote-style = "single"
5989

6090
# Isort settings
6191
[tool.ruff.lint.isort]

0 commit comments

Comments
 (0)