[pylint] Also reports case np.nan/case math.nan (PLW0177)#16378
Merged
ntBre merged 4 commits intoastral-sh:mainfrom Feb 26, 2025
Merged
[pylint] Also reports case np.nan/case math.nan (PLW0177)#16378ntBre merged 4 commits intoastral-sh:mainfrom
pylint] Also reports case np.nan/case math.nan (PLW0177)#16378ntBre merged 4 commits intoastral-sh:mainfrom
Conversation
Contributor
|
Member
|
@ntBre could you take a look at this PR? |
InSyncWithFoo
commented
Feb 26, 2025
InSyncWithFoo
commented
Feb 26, 2025
ntBre
reviewed
Feb 26, 2025
ntBre
reviewed
Feb 26, 2025
ntBre
reviewed
Feb 26, 2025
ntBre
approved these changes
Feb 26, 2025
Contributor
ntBre
left a comment
There was a problem hiding this comment.
Thanks for your work on this and for the clarification on my match comments! I left a slightly different implementation strategy suggestion for your consideration, but I'm happy with this one too if you are.
ed1e215 to
92b819c
Compare
dcreager
added a commit
that referenced
this pull request
Feb 27, 2025
* main: [red-knot] unify LoopState and saved_break_states (#16406) [`pylint`] Also reports `case np.nan`/`case math.nan` (`PLW0177`) (#16378) [FURB156] Do not consider docstring(s) (#16391) Use `is_none_or` in `stdlib-module-shadowing` (#16402) [red-knot] Upgrade salsa to include `AtomicPtr` perf improvement (#16398) [red-knot] Fix file watching for new non-project files (#16395) document MSRV policy (#16384) [red-knot] fix non-callable reporting for unions (#16387) bump MSRV to 1.83 (#16294) Avoid unnecessary info at non-trace server log level (#16389) Expand `ruff.configuration` to allow inline config (#16296) Start detecting version-related syntax errors in the parser (#16090)
dcreager
added a commit
that referenced
this pull request
Feb 27, 2025
* dcreager/dont-have-a-cow: [red-knot] unify LoopState and saved_break_states (#16406) [`pylint`] Also reports `case np.nan`/`case math.nan` (`PLW0177`) (#16378) [FURB156] Do not consider docstring(s) (#16391) Use `is_none_or` in `stdlib-module-shadowing` (#16402) [red-knot] Upgrade salsa to include `AtomicPtr` perf improvement (#16398) [red-knot] Fix file watching for new non-project files (#16395) document MSRV policy (#16384) [red-knot] fix non-callable reporting for unions (#16387) bump MSRV to 1.83 (#16294) Avoid unnecessary info at non-trace server log level (#16389) Expand `ruff.configuration` to allow inline config (#16296) Start detecting version-related syntax errors in the parser (#16090)
dcreager
added a commit
that referenced
this pull request
Feb 27, 2025
* main: [red-knot] unify LoopState and saved_break_states (#16406) [`pylint`] Also reports `case np.nan`/`case math.nan` (`PLW0177`) (#16378) [FURB156] Do not consider docstring(s) (#16391) Use `is_none_or` in `stdlib-module-shadowing` (#16402) [red-knot] Upgrade salsa to include `AtomicPtr` perf improvement (#16398) [red-knot] Fix file watching for new non-project files (#16395) document MSRV policy (#16384) [red-knot] fix non-callable reporting for unions (#16387) bump MSRV to 1.83 (#16294) Avoid unnecessary info at non-trace server log level (#16389) Expand `ruff.configuration` to allow inline config (#16296) Start detecting version-related syntax errors in the parser (#16090)
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.
Summary
Resolves #16374.
PLW0177now also reports the pattern of a case branch if it is an attribute access whose qualified name is that of eithernp.nanormath.nan.As the rule is in preview, the changes are not preview-gated.
Test Plan
cargo nextest runandcargo insta test.