[pygrep-hooks] Detect non-existent mock methods in standalone expressions (PGH005)#22830
Conversation
ntBre
left a comment
There was a problem hiding this comment.
Thank you! This looks like a nice, straightforward change. Let's make it a preview change, though, since it's a big expansion to a stable rule.
I'll also be curious to see how the ecosystem results look once CI runs. Hopefully there aren't too many false positives, as Alex mentioned on the issue.
|
|
Well, I wouldn't worry too much about these ecosystem checks. Such spurious results are usually just from CI not being approved soon enough. Once you push another commit, I'd expect them to clear up. |
06ac47a to
da0f2d4
Compare
|
@ntBre Thanks for the review! I've gated the standalone expression detection behind preview mode
Stable behavior is unchanged; the standalone expansion only fires in preview. Would like to request you for your re-review. thank you |
ntBre
left a comment
There was a problem hiding this comment.
Thank you! I'll wait for the ecosystem check, but assuming it looks good, I'll merge this right after.
pygrep-hooks] Detect non-existent mock methods in standalone expressions (PGH005pygrep-hooks] Detect non-existent mock methods in standalone expressions (PGH005)
Summary
Extends
PGH005to detect non-existent mock methods likemock.not_called()when used asstandalone expressions, not just inside
assertstatements.Closes #13252
Test Plan
cargo nextest run -p ruff_linter pygrep_hooks