diff --git a/.ruff.toml b/.ruff.toml index 2cc4145ed..2b534c3f9 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -270,12 +270,16 @@ logger-objects = [ "ANN", # documentation doesn't need annotations "TC001", # documentation doesn't need type-checking blocks ] -"doc/conf.py" = ["INP001", "W605"] -"doc/development/tutorials/examples/*" = ["I002", "INP001"] -# allow print() in the tutorial +"doc/conf.py" = [ + "INP001", # doc/ is not a namespace package +] +"doc/development/tutorials/examples/*" = [ + "I002", # we don't need the annotations future + "INP001", # examples/ is not a namespace package +] "doc/development/tutorials/examples/recipe.py" = [ - "FURB118", - "T201" + "FURB118", # keep the tutorial simple: no itemgetter + "T201" # allow print() in the tutorial ] "doc/usage/extensions/example_{google,numpy}.py" = [ "D416", # Section name should end with a colon ("{name}") @@ -284,9 +288,6 @@ logger-objects = [ "PLW3201", # Dunder method {name} has no special meaning in Python 3 ] -# from .flake8 -"sphinx/*" = ["E241"] - # whitelist ``print`` for stdout messages "sphinx/_cli/__init__.py" = ["T201"] @@ -310,18 +311,11 @@ logger-objects = [ # whitelist ``token`` in docstring parsing "sphinx/ext/napoleon/docstring.py" = ["S105"] +"sphinx/search/*" = ["RUF001"] + # whitelist ``print`` for stdout messages "sphinx/testing/fixtures.py" = ["T201"] -# Ruff bug: https://github.com/astral-sh/ruff/issues/6540 -"sphinx/transforms/i18n.py" = ["PGH004"] - -# Function wrappers -"sphinx/ext/autodoc/importer.py" = ["D402"] -"sphinx/util/requests.py" = ["D402"] - -"sphinx/search/*" = ["E501", "RUF001"] - # whitelist ``token`` in date format parsing "sphinx/util/i18n.py" = ["S105"] diff --git a/sphinx/search/__init__.py b/sphinx/search/__init__.py index 9fa43338a..39516e2cf 100644 --- a/sphinx/search/__init__.py +++ b/sphinx/search/__init__.py @@ -407,12 +407,12 @@ class IndexBuilder: def get_terms( self, fn2index: dict[str, int] ) -> tuple[dict[str, list[int] | int], dict[str, list[int] | int]]: - """ - Return a mapping of document and title terms to their corresponding sorted document IDs. + """Return a mapping of document and title terms to sorted document IDs. - When a term is only found within a single document, then the value for that term will be - an integer value. When a term is found within multiple documents, the value will be a list - of integers. + When a term is only found within a single document, + then the value for that term will be an integer value. + When a term is found within multiple documents, + the value will be a list of integers. """ rvs: tuple[dict[str, list[int] | int], dict[str, list[int] | int]] = ({}, {}) for rv, mapping in zip(rvs, (self._mapping, self._title_mapping), strict=True): diff --git a/sphinx/search/fi.py b/sphinx/search/fi.py index f6c222643..24ef75023 100644 --- a/sphinx/search/fi.py +++ b/sphinx/search/fi.py @@ -95,7 +95,7 @@ kun | when niin | so nyt | now itse | self -""") +""") # NoQA: E501 class SearchFinnish(SearchLanguage): diff --git a/sphinx/search/nl.py b/sphinx/search/nl.py index 98f924dde..2d2f2b8a8 100644 --- a/sphinx/search/nl.py +++ b/sphinx/search/nl.py @@ -109,7 +109,7 @@ uw | your iemand | somebody geweest | been; past participle of 'be' andere | other -""") +""") # NoQA: E501 class SearchDutch(SearchLanguage):