summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Turner <9087854+aa-turner@users.noreply.github.com>2023-04-05 14:18:31 +0100
committerAdam Turner <9087854+aa-turner@users.noreply.github.com>2023-04-05 14:19:43 +0100
commit52a099b7ec9b08aa034c05c515d7ba5e6f7b004c (patch)
treee0a7dee981dbd3a4c81e36cce87db4b33cb27ef5
parent2932bacac453d8150c6d4cd3e81ce37739c11ba0 (diff)
downloadsphinx-git-52a099b7ec9b08aa034c05c515d7ba5e6f7b004c.tar.gz
Resolve lint errors from Ruff 0.0.261
-rw-r--r--.github/workflows/lint.yml2
-rw-r--r--pyproject.toml6
-rw-r--r--sphinx/writers/text.py3
-rw-r--r--tests/test_config.py6
4 files changed, 5 insertions, 12 deletions
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index f7da8ede2..fb23ae1a9 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -26,7 +26,7 @@ jobs:
run: python -m pip install --upgrade pip
- name: Install known good Ruff
- run: python -m pip install ruff==0.0.260
+ run: python -m pip install ruff==0.0.261
- name: Lint with known good Ruff
run: ruff . --diff --format github
diff --git a/pyproject.toml b/pyproject.toml
index 1e7dde11e..4c3badd26 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -285,17 +285,11 @@ select = [
"doc/conf.py" = ["INP001"]
"doc/development/tutorials/examples/*" = ["INP001"]
-# Ruff false positive: https://github.com/charliermarsh/ruff/issues/3830
-"sphinx/domains/c.py" = ["SIM222"]
-
"sphinx/environment/collectors/toctree.py" = ["B026"]
"sphinx/environment/adapters/toctree.py" = ["B026"]
"tests/*" = ["E501"]
-# Ruff false positive: https://github.com/charliermarsh/ruff/issues/3831
-"tests/test_config.py" = ["B018"]
-
[tool.ruff.flake8-quotes]
inline-quotes = "single"
diff --git a/sphinx/writers/text.py b/sphinx/writers/text.py
index d194f0eeb..3bce03ac6 100644
--- a/sphinx/writers/text.py
+++ b/sphinx/writers/text.py
@@ -323,8 +323,7 @@ class TextWrapper(textwrap.TextWrapper):
if w == 1:
chunks.extend(split(''.join(g)))
else:
- # Ruff false positive: https://github.com/charliermarsh/ruff/issues/3829
- chunks.extend(list(g)) # NoQA: B031
+ chunks.extend(list(g))
return chunks
def _handle_long_word(self, reversed_chunks: list[str], cur_line: list[str],
diff --git a/tests/test_config.py b/tests/test_config.py
index 42b91ab69..f4a82ea7c 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -48,13 +48,13 @@ def test_core_config(app, status, warning):
# invalid values
with pytest.raises(AttributeError):
- cfg._value
+ _ = cfg._value
with pytest.raises(AttributeError):
- cfg.nonexisting_value
+ _ = cfg.nonexisting_value
# non-value attributes are deleted from the namespace
with pytest.raises(AttributeError):
- cfg.sys
+ _ = cfg.sys
# setting attributes
cfg.project = 'Foo'