Resolve lint errors from Ruff 0.0.261

This commit is contained in:
Adam Turner
2023-04-05 14:18:31 +01:00
parent 2932bacac4
commit 52a099b7ec
4 changed files with 5 additions and 12 deletions

View File

@@ -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

View File

@@ -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"

View File

@@ -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],

View File

@@ -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'