Skip to content

Commit

Permalink
Bump Ruff to 0.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Nov 14, 2024
1 parent e299d69 commit efc36ac
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 31 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
24 changes: 11 additions & 13 deletions sphinx/search/en.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """
/**
Expand Down
24 changes: 11 additions & 13 deletions sphinx/search/zh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """
/**
Expand Down
2 changes: 1 addition & 1 deletion sphinx/testing/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/test_extensions/test_ext_autodoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion tests/test_extensions/test_ext_intersphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from typing import NoReturn


class FakeList(list):
class FakeList(list): # NoQA: FURB189
def __iter__(self) -> NoReturn:
raise NotImplementedError

Expand Down

0 comments on commit efc36ac

Please sign in to comment.