Enable the RUF036 lint in Ruff

This commit is contained in:
Adam Turner
2024-12-01 09:30:55 +00:00
parent a843532161
commit 9f0194de65
2 changed files with 5 additions and 5 deletions

View File

@@ -251,7 +251,7 @@ select = [
"RUF033", # `__post_init__` method with argument defaults
"RUF034", # Useless `if`-`else` condition
"RUF035", # Unsafe use of `{name}` detected
# "RUF036", # `None` not at the end of the type annotation.
"RUF036", # `None` not at the end of the type annotation.
"RUF038", # `Literal[True, False, ...]` can be replaced with `Literal[...] | bool`
# "RUF039", # First argument to {call} is not raw string
"RUF040", # Non-string literal used as assert message
@@ -367,7 +367,7 @@ select = [
]
# these tests need old ``typing`` generic aliases
"tests/test_util/test_util_typing.py" = ["UP006", "UP007", "UP035"]
"tests/test_util/test_util_typing.py" = ["RUF036", "UP006", "UP007", "UP035"]
"tests/test_util/typing_test_data.py" = ["FA100", "I002", "PYI030", "UP006", "UP007", "UP035"]
"utils/*" = [

View File

@@ -161,9 +161,9 @@ class SphinxLoggerAdapter(logging.LoggerAdapter):
self,
msg: object,
*args: object,
type: None | str = None,
subtype: None | str = None,
location: None | str | tuple[str | None, int | None] | Node = None,
type: str | None = None,
subtype: str | None = None,
location: str | tuple[str | None, int | None] | Node | None = None,
nonl: bool = True,
color: str | None = None,
once: bool = False,