Skip to content

⬆️ Toolchain: ruff 0.17.4, mypy 2.4.1, explicit ruff base rules - #312

Merged
chrisjsewell merged 5 commits into
mainfrom
maint/toolchain-2026-11
Nov 9, 2026
Merged

chrisjsewell merged 5 commits into
mainfrom
maint/toolchain-2026-11

Conversation

@chrisjsewell

Copy link
Copy Markdown
Member

Brings the linters up to date in one place, replacing the two bot PRs that bumped them to different versions.

  • ruff 0.17.4 and mypy 2.4.1, in .pre-commit-config.yaml and in the [dependency-groups] pins the tox ruff-* / mypy environments use, so the two match.
  • ruff's base rule set is pinned: select = ["E4", "E7", "E9", "F"] under [tool.ruff.lint], with the existing extend-select / extend-ignore unchanged.
    ruff 0.16 grew its default set from 59 rules to about 400, so an unset select changes what is linted on every upgrade.
    At ruff 0.15.21 the pin is a no-op (identical enabled rule set).
    Under 0.17.4 it takes the findings from 34 to 18, and this PR fixes those 18:
    17 × ISC004 in tools/generate_css.py (multi-line CSS rules wrapped in parentheses; the generated sphinx-design.min.css is byte-identical)
    and 1 × PLR0917 on the badge role's __call__, whose positional signature is the docutils role interface (silenced next to PLR0913).
  • The ruff-format hook now also formats Python code blocks in Markdown: one block in CHANGELOG.md (the 0.6.0 sd_custom_directives example) and one in docs/css_variables.md are re-indented/re-quoted. These are the same two edits [pre-commit.ci] pre-commit autoupdate #296 made.
  • From ⬆️ Bump the python-deps group across 1 directory with 4 updates #305: flit_core >=3.4,<5 (sdist and wheel built with flit_core 4.2.0 hold the same files as with 3.12.0, and the package files are byte-identical; the metadata becomes Metadata-Version 2.5 with Import-Name: sphinx_design, and twine check --strict passes)
    and pydata-sphinx-theme>=0.20,<0.22 (docs build -nW with 0.21.0).
  • Dependabot's pip entry now ignores ruff and mypy: pre-commit.ci owns those versions.

Supersedes #296 and #305.

ruff 0.16 grew its default rule set from 59 rules to about 400,
so leaving `select` unset changes what is linted on every ruff upgrade.
`select = ["E4", "E7", "E9", "F"]` is the old default, so at the current
ruff 0.15.21 this changes nothing (the enabled rule set is identical);
the existing extend-select / extend-ignore lists are kept as they are.
ruff 0.17 flags an implicit concatenation inside a collection literal (ISC004),
since a missing comma there silently joins two items.
Wrap the 17 multi-line CSS rules in tools/generate_css.py in parentheses
so each one reads as a single item.
The generated sphinx-design.min.css is byte-identical.
Bump both in .pre-commit-config.yaml and in the [dependency-groups] pins
that the tox ruff/mypy environments use, so the two stay in step.

- With the base rule set pinned, ruff 0.17.4 reports one new finding:
  PLR0917 on the badge role's `__call__`, whose positional signature is
  the docutils role interface, so it is silenced next to PLR0913.
- The ruff-format hook now also formats Python code blocks in Markdown;
  this reformats one block in CHANGELOG.md and one in docs/css_variables.md.
- mypy 2.4.1 reports nothing new.
Taken from the Dependabot python-deps update (#305), without its ruff/mypy
pins, which the previous commit sets to match the pre-commit revs.

- flit_core <5: the sdist and wheel built with flit_core 4.2.0 hold the same
  files as with 3.12.0, and the package files are byte-identical; only the
  metadata changes (Metadata-Version 2.5, adding `Import-Name: sphinx_design`),
  and `twine check --strict` passes.
- pydata-sphinx-theme <0.22: the docs build with 0.21.0 under `-nW`.
pre-commit.ci and Dependabot both bumped the linters, to different versions
(#296 against #305). pre-commit.ci owns them in .pre-commit-config.yaml,
and the [dependency-groups] pins follow those revs by hand,
so the pip entry now ignores ruff and mypy.
@codecov

codecov Bot commented Nov 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.63%. Comparing base (7b309b9) to head (b9435f3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #312   +/-   ##
=======================================
  Coverage   92.63%   92.63%           
=======================================
  Files          13       13           
  Lines        1371     1371           
=======================================
  Hits         1270     1270           
  Misses        101      101           
Flag Coverage Δ
pytests 92.63% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@chrisjsewell
chrisjsewell merged commit 7e4a71f into main Nov 9, 2026
27 of 28 checks passed
@chrisjsewell
chrisjsewell deleted the maint/toolchain-2026-11 branch November 9, 2026 20:25
chrisjsewell added a commit to dipinknair/sphinx-design that referenced this pull request Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant