DM-55493: scope PLR0917 for ruff 0.16 - #356
Merged
Merged
Conversation
Ruff 0.16.0 stabilized PLR0917 (too-many-positional-arguments), which flags the seven Sphinx role functions in src/documenteer/ext/. Their signature is fixed by the docutils/Sphinx role API and Sphinx calls them positionally, so add a repo-local per-file ignore rather than change the signatures.
jonathansick
added a commit
that referenced
this pull request
Jul 27, 2026
…toml ruff-shared.toml already sets [lint.isort] split-on-trailing-comma = false, so the pyproject copy is dead config. Clears the toml-not-redundant check of the ruff-shared-config migration. This was meant to ride along with #356 but that PR merged ~1 minute before the change was pushed, so the commit landed on an already-merged branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Ruff 0.16.0 stabilized
PLR0917(too-many-positional-arguments), which hadpreviously been a preview-only rule. Because
ruff-shared.tomlselectsALLand does not list
PLR0917among its ignores, the rule becomes active for thisrepo the moment the pinned ruff crosses 0.16.0 — surfacing 7 new errors that a
routine pre-commit autoupdate would turn into a red CI run.
Verified against ruff 0.16.0 specifically (the pinned
ruff-pre-commitrev isstill
v0.15.20, which does not report the rule):ISC004reported nothing in this repo, before or after.Why a scoped ignore rather than a code fix
All 7 findings are Sphinx role functions. Their signature is not ours to
choose — docutils and Sphinx define the role calling convention as
and Sphinx invokes registered roles positionally. Marking any of those
parameters keyword-only (the fix
PLR0917wants) would raiseTypeErroratdocumentation-build time for every project using
:jira:,:jirab:,:jirap:, the:sqr:/:dmtn:/etc. shortlinks,:lsst-doc:, and the mock:lmod:/:lclass:/:lfunc:roles. The rule is measuring a real propertyhere, but the property is imposed by an external API, so the correct
disposition is to exempt the directory rather than to "fix" the code.
The ignore is deliberately narrow —
src/documenteer/ext/*, the only placerole functions live — so
PLR0917keeps its teeth everywhere else in thepackage.
Changes
One entry added to
[tool.ruff.lint.extend-per-file-ignores]inpyproject.toml, matching the style of the existing entries, with a commentrecording the rationale:
No Python source was touched.
ruff-shared.tomlis deliberately notmodified — it is a vendored copy of the shared SQuaRE config and must keep
matching its upstream source.
Validation
uvx ruff@0.16.0 check --select PLR0917,ISC004 .— 7 errors before,All checks passed!afteruvx ruff@0.15.20 check .(the currently pinned version) — clean; the newkey is accepted, not just ignored
uvx ruff@0.15.20 format --check .— 92 files already formattednox -s typing test— 18/18 sessions green (Python 3.12/3.13/3.14 ×Sphinx 8/9/dev; 181 tests per test session)
No changelog fragment: this is lint configuration only, with no user-visible
behavior change.