Skip to content

Commit 9f0194d

Browse files
committed
Enable the RUF036 lint in Ruff
1 parent a843532 commit 9f0194d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.ruff.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ select = [
251251
"RUF033", # `__post_init__` method with argument defaults
252252
"RUF034", # Useless `if`-`else` condition
253253
"RUF035", # Unsafe use of `{name}` detected
254-
# "RUF036", # `None` not at the end of the type annotation.
254+
"RUF036", # `None` not at the end of the type annotation.
255255
"RUF038", # `Literal[True, False, ...]` can be replaced with `Literal[...] | bool`
256256
# "RUF039", # First argument to {call} is not raw string
257257
"RUF040", # Non-string literal used as assert message
@@ -367,7 +367,7 @@ select = [
367367
]
368368

369369
# these tests need old ``typing`` generic aliases
370-
"tests/test_util/test_util_typing.py" = ["UP006", "UP007", "UP035"]
370+
"tests/test_util/test_util_typing.py" = ["RUF036", "UP006", "UP007", "UP035"]
371371
"tests/test_util/typing_test_data.py" = ["FA100", "I002", "PYI030", "UP006", "UP007", "UP035"]
372372

373373
"utils/*" = [

sphinx/util/logging.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ def warning( # type: ignore[override]
161161
self,
162162
msg: object,
163163
*args: object,
164-
type: None | str = None,
165-
subtype: None | str = None,
166-
location: None | str | tuple[str | None, int | None] | Node = None,
164+
type: str | None = None,
165+
subtype: str | None = None,
166+
location: str | tuple[str | None, int | None] | Node | None = None,
167167
nonl: bool = True,
168168
color: str | None = None,
169169
once: bool = False,

0 commit comments

Comments
 (0)