Skip to content

Chore: Ignore PLR0917 in test suites - #148

Merged
tykeal merged 1 commit into
lfreleng-actions:mainfrom
modeseven-lfreleng-actions:chore/pin-ruff-plr0917
Jul 30, 2026
Merged

Chore: Ignore PLR0917 in test suites#148
tykeal merged 1 commit into
lfreleng-actions:mainfrom
modeseven-lfreleng-actions:chore/pin-ruff-plr0917

Conversation

@ModeSevenIndustrialSolutions

Copy link
Copy Markdown
Contributor

Why

ruff 0.16.0 stabilised PLR0917 ("too many positional arguments"). This repository already selects the PL category, so the rule began firing on six test functions the moment the pre-commit autoupdate crossed that version boundary — on code nobody had touched. That is what fails the open autoupdate PR #145 here.

Tests that stack @patch decorators cannot satisfy it: unittest.mock injects each mock positionally, so a keyword-only signature is impossible rather than merely inconvenient.

PLR0913, the sibling rule counting all arguments, is already ignored globally here. This adds its positional-only counterpart to the test per-file-ignores, matching the convention adopted across the organisation when the same release broke fifteen repositories at once.

Verified

All checks pass under both ruff 0.15.22 (currently pinned) and 0.16.0 (what the autoupdate PR moves to).

ruff 0.16.0 stabilised PLR0917, "too many positional arguments". This
repository already selects the PL category, so the rule began firing on
six test functions the moment the pre-commit autoupdate crossed that
version boundary, on code nobody had touched.

Tests that stack @patch decorators cannot satisfy it. unittest.mock
injects each mock positionally, so a keyword-only signature is
impossible rather than merely inconvenient.

PLR0913, the sibling rule counting all arguments, is already ignored
globally here. This adds its positional-only counterpart to the test
per-file-ignores, matching the convention the organisation adopted when
the same release broke fifteen repositories at once.

Verified against both ruff versions: all checks pass under 0.15.22, the
currently pinned release, and under 0.16.0, which the open autoupdate
pull request moves to.

Co-authored-by: Claude <claude@anthropic.com>
Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions requested review from a team and Copilot July 30, 2026 12:17
@github-actions github-actions Bot added the chore Code chores (dependency updates, etc) label Jul 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Ruff configuration to prevent PLR0917 (“too many positional arguments”) from failing test suites, aligning the test linting rules with how unittest.mock.patch injects mocks positionally.

Changes:

  • Add PLR0917 to Ruff per-file-ignores for tests/**/*.py.
  • Document why PLR0917 is not actionable for tests that stack @patch decorators, and how this relates to the already-ignored PLR0913.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tykeal
tykeal merged commit c9db4de into lfreleng-actions:main Jul 30, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Code chores (dependency updates, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants