diff --git a/pyproject.toml b/pyproject.toml index 619b686ce7d..1c0167adf41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -92,7 +92,7 @@ docs = [ "sphinxcontrib-websupport", ] lint = [ - "ruff==0.9.6", + "ruff==0.9.7", "mypy==1.15.0", "sphinx-lint>=0.9", "types-colorama==0.4.15.20240311", diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py index dd904923a08..8cdb039df3e 100644 --- a/sphinx/ext/autodoc/__init__.py +++ b/sphinx/ext/autodoc/__init__.py @@ -291,7 +291,7 @@ def process( # This class is used only in ``sphinx.ext.autodoc.directive``, # But we define this class here to keep compatibility # See: https://github.com/sphinx-doc/sphinx/issues/4538 -class Options(dict[str, Any]): +class Options(dict[str, Any]): # NoQA: FURB189 """A dict/attribute hybrid that returns None on nonexisting keys.""" def copy(self) -> Options: diff --git a/sphinx/ext/autodoc/directive.py b/sphinx/ext/autodoc/directive.py index 35177f9d239..03d6383e0e1 100644 --- a/sphinx/ext/autodoc/directive.py +++ b/sphinx/ext/autodoc/directive.py @@ -52,7 +52,7 @@ }) -class DummyOptionSpec(dict[str, Callable[[str], str]]): +class DummyOptionSpec(dict[str, Callable[[str], str]]): # NoQA: FURB189 """An option_spec allows any options.""" def __bool__(self) -> bool: diff --git a/sphinx/ext/autodoc/mock.py b/sphinx/ext/autodoc/mock.py index 30e5ff05b42..236174a62f9 100644 --- a/sphinx/ext/autodoc/mock.py +++ b/sphinx/ext/autodoc/mock.py @@ -30,7 +30,7 @@ class _MockObject: __sphinx_mock__ = True __sphinx_decorator_args__: tuple[Any, ...] = () - def __new__(cls, *args: Any, **kwargs: Any) -> Any: + def __new__(cls, *args: Any, **kwargs: Any) -> Any: # NoQA: ARG004 if len(args) == 3 and isinstance(args[1], tuple): superclass = args[1][-1].__class__ if superclass is cls: diff --git a/sphinx/util/_files.py b/sphinx/util/_files.py index f0a23f936b8..68ac888fea8 100644 --- a/sphinx/util/_files.py +++ b/sphinx/util/_files.py @@ -11,7 +11,7 @@ from collections.abc import Set -class FilenameUniqDict(dict[str, tuple[set[str], str]]): +class FilenameUniqDict(dict[str, tuple[set[str], str]]): # NoQA: FURB189 """A dictionary that automatically generates unique names for its keys, interpreted as filenames, and keeps track of a set of docnames they appear in. Used for images and downloadable files in the environment. @@ -61,7 +61,7 @@ def __setstate__(self, state: set[str]) -> None: self._existing = state -class DownloadFiles(dict[Path, tuple[set[str], _StrPath]]): +class DownloadFiles(dict[Path, tuple[set[str], _StrPath]]): # NoQA: FURB189 """A special dictionary for download files. .. important:: This class would be refactored in nearly future. diff --git a/tests/test_extensions/test_ext_autodoc.py b/tests/test_extensions/test_ext_autodoc.py index 7a06a63db0d..a06c1bbe30d 100644 --- a/tests/test_extensions/test_ext_autodoc.py +++ b/tests/test_extensions/test_ext_autodoc.py @@ -221,7 +221,7 @@ def __init__(self, a, b=None): pass class FNew: - def __new__(cls, a, b=None): + def __new__(cls, a, b=None): # NoQA: ARG004 return super().__new__(cls) class FMeta(metaclass=SomeMeta): diff --git a/tests/test_extensions/test_ext_intersphinx.py b/tests/test_extensions/test_ext_intersphinx.py index d47f33f1744..c2b17d36a78 100644 --- a/tests/test_extensions/test_ext_intersphinx.py +++ b/tests/test_extensions/test_ext_intersphinx.py @@ -45,7 +45,7 @@ from sphinx.util.typing import Inventory -class FakeList(list[str]): +class FakeList(list[str]): # NoQA: FURB189 def __iter__(self) -> NoReturn: raise NotImplementedError