Skip to content

Commit 18a51b9

Browse files
Merge pull request #2497 from VWS-Python/duplicate-ruff-config
Remove a few ruff ignores
2 parents 9dbc75b + 2131856 commit 18a51b9

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

docs/source/conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@
4646
requires_python = project_metadata["Requires-Python"]
4747
specifiers = SpecifierSet(specifiers=requires_python)
4848
(specifier,) = specifiers
49-
assert specifier.operator == ">="
49+
if specifier.operator != ">=":
50+
msg = (
51+
f"We only support '>=' for Requires-Python, got {specifier.operator}."
52+
)
53+
raise ValueError(msg)
5054
minimum_python_version = specifier.version
5155

5256
language = "en"

pyproject.toml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,27 +114,32 @@ lint.select = [
114114
"ALL",
115115
]
116116
lint.ignore = [
117-
# We are happy to manage our own "complexity".
118-
"C901",
119117
# Ruff warns that this conflicts with the formatter.
120118
"COM812",
121119
# Allow our chosen docstring line-style - no one-line summary.
122120
"D200",
123121
"D205",
124122
"D212",
125-
"D415",
126123
# Ruff warns that this conflicts with the formatter.
127124
"ISC001",
128125
# Ignore "too-many-*" errors as they seem to get in the way more than
129126
# helping.
130127
"PLR0913",
131-
# Allow 'assert' as we use it for tests.
128+
]
129+
130+
lint.per-file-ignores."doccmd_*.py" = [
131+
# Allow asserts in docs.
132+
"S101",
133+
]
134+
135+
lint.per-file-ignores."docs/source/*.py" = [
136+
# Allow asserts in docs.
132137
"S101",
133138
]
134139

135140
lint.per-file-ignores."tests/*.py" = [
136-
# Do not require tests to have a one-line summary.
137-
"D205",
141+
# Allow asserts in tests.
142+
"S101",
138143
]
139144

140145
# Do not automatically remove commented out code.

0 commit comments

Comments
 (0)