Skip to content

Commit

Permalink
Resolve lint errors from Ruff 0.0.261
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Apr 5, 2023
1 parent 2932bac commit 52a099b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 0 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
3 changes: 1 addition & 2 deletions sphinx/writers/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,7 @@ def split(t: str) -> list[str]:
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],
Expand Down
6 changes: 3 additions & 3 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 52a099b

Please sign in to comment.