From efc36ac38fbb73bcd25ee09ab635446d9f001abe Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:40:34 +0000 Subject: [PATCH] Bump Ruff to 0.7.3 --- pyproject.toml | 2 +- sphinx/search/en.py | 24 +++++++++---------- sphinx/search/zh.py | 24 +++++++++---------- sphinx/testing/path.py | 2 +- tests/test_extensions/test_ext_autodoc.py | 4 ++-- tests/test_extensions/test_ext_intersphinx.py | 2 +- 6 files changed, 27 insertions(+), 31 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1aac35123a8..11ed6a00b9d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,7 +82,7 @@ docs = [ ] lint = [ "flake8>=6.0", - "ruff==0.7.2", + "ruff==0.7.3", "mypy==1.13.0", "sphinx-lint>=0.9", "types-colorama==0.4.15.20240311", diff --git a/sphinx/search/en.py b/sphinx/search/en.py index 11ebb683836..5173dc03fc0 100644 --- a/sphinx/search/en.py +++ b/sphinx/search/en.py @@ -6,19 +6,17 @@ from sphinx.search import SearchLanguage -english_stopwords = set( - """ -a and are as at -be but by -for -if in into is it -near no not -of on or -such -that the their then there these they this to -was will with -""".split() -) +english_stopwords = { + 'a', 'and', 'are', 'as', 'at', + 'be', 'but', 'by', + 'for', + 'if', 'in', 'into', 'is', 'it', + 'near', 'no', 'not', + 'of', 'on', 'or', + 'such', + 'that', 'the', 'their', 'then', 'there', 'these', 'they', 'this', 'to', + 'was', 'will', 'with', +} # fmt: skip js_porter_stemmer = """ /** diff --git a/sphinx/search/zh.py b/sphinx/search/zh.py index 28251e8c1db..342b566512a 100644 --- a/sphinx/search/zh.py +++ b/sphinx/search/zh.py @@ -18,19 +18,17 @@ JIEBA = False JIEBA_DEFAULT_DICT = Path() -english_stopwords = set( - """ -a and are as at -be but by -for -if in into is it -near no not -of on or -such -that the their then there these they this to -was will with -""".split() -) +english_stopwords = { + 'a', 'and', 'are', 'as', 'at', + 'be', 'but', 'by', + 'for', + 'if', 'in', 'into', 'is', 'it', + 'near', 'no', 'not', + 'of', 'on', 'or', + 'such', + 'that', 'the', 'their', 'then', 'there', 'these', 'they', 'this', 'to', + 'was', 'will', 'with', +} # fmt: skip js_porter_stemmer = """ /** diff --git a/sphinx/testing/path.py b/sphinx/testing/path.py index b469588ea6d..3419ccbc893 100644 --- a/sphinx/testing/path.py +++ b/sphinx/testing/path.py @@ -32,7 +32,7 @@ def getumask() -> int: UMASK = getumask() -class path(str): +class path(str): # NoQA: FURB189 """ Represents a path which behaves like a string. """ diff --git a/tests/test_extensions/test_ext_autodoc.py b/tests/test_extensions/test_ext_autodoc.py index dbe0fbe1d71..eb775aba081 100644 --- a/tests/test_extensions/test_ext_autodoc.py +++ b/tests/test_extensions/test_ext_autodoc.py @@ -216,7 +216,7 @@ class GMeta(FMeta): assert formatsig('class', 'C', C, None, None) == '(a, b=None)' assert formatsig('class', 'C', D, 'a, b', 'X') == '(a, b) -> X' - class ListSubclass(list): + class ListSubclass(list): # NoQA: FURB189 pass # only supported if the python implementation decides to document it @@ -1527,7 +1527,7 @@ def _node( tab = ' ' * 3 def rst_option(name: str, value: Any) -> str: - value = '' if value in {1, True} else value + value = '' if value == 1 else value # note True == 1. return f'{prefix}{tab}:{name}: {value!s}'.rstrip() lines = [ diff --git a/tests/test_extensions/test_ext_intersphinx.py b/tests/test_extensions/test_ext_intersphinx.py index ffc99032695..5aaa91d9365 100644 --- a/tests/test_extensions/test_ext_intersphinx.py +++ b/tests/test_extensions/test_ext_intersphinx.py @@ -41,7 +41,7 @@ from typing import NoReturn -class FakeList(list): +class FakeList(list): # NoQA: FURB189 def __iter__(self) -> NoReturn: raise NotImplementedError