mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Resolve lint errors from Ruff 0.0.261
This commit is contained in:
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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],
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user