fix: keep PR07-PR09 checks for option-set parameter types - #705
Open
dylanpulver wants to merge 1 commit into
Open
fix: keep PR07-PR09 checks for option-set parameter types#705dylanpulver wants to merge 1 commit into
dylanpulver wants to merge 1 commit into
Conversation
The guard added in numpy#347 suppresses the common-type (PR06) checks when a parameter type is a set of options. It does so with a continue, which advances the parameter loop and therefore also skips the _check_desc call at the end of the loop body, silently disabling PR07, PR08 and PR09 for those parameters. Negate the guard instead so only the PR06 block is skipped.
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.
The options-set guard from #347 suppresses PR06 with a
continue, which advances the parameter loop and skips the_check_desccall at the end of the loop body. Parameters typed as an options set have gone unchecked for PR07 through PR09 since b5b7e25.Minimal pair, differing only in the type line:
Constraint on the fix: the order of
errsis asserted by severaltest_bad_docstringsexpectations. Moving the_check_desccall above the type checks removes the same symptom but reorders codes withinerrs, so I negated the guard instead, which leaves the PR06 suppression and the emission order untouched.Residual limitation: the guard keys on
{appearing anywhere in the type, so a malformed type containing a brace now gets description checks it escaped before. That matches how every non-options type is treated, and narrowing it would change PR06 behaviour beyond the scope of this fix.Measurement: 315 passed before, 317 after, on Python 3.12. Both added cases fail with
validate.pyreverted.valid_options_in_parameter_description_setscontinues to pin the PR06 suppression from #347.Worth weighing before a release: five suppressed findings reappear in matplotlib, among them
pyplot.hlineslinestyles(no description) andpyplot.quiverunits(PR09).Prepared with AI assistance.