Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip B028 if warnings.warn is called with *args or **kwargs #501

Merged
merged 2 commits into from
Dec 9, 2024

Conversation

harupy
Copy link
Contributor

@harupy harupy commented Dec 7, 2024

B028 should be skipped if warnings.warn is called with *args or **kwargs. They might contain stacklevel.

@harupy harupy changed the title Avoid raising B028 if warnings.warn contains *args or **kwargs Skip B028 if warnings.warn contains *args or **kwargs Dec 7, 2024
@harupy harupy changed the title Skip B028 if warnings.warn contains *args or **kwargs Skip B028 if warnings.warn is called with *args or **kwargs Dec 7, 2024
Copy link
Collaborator

@cooperlees cooperlees left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM - Makes sense to down noise when we can't be sure.

Just one question on maybe a little more test coverage.

tests/b028.py Show resolved Hide resolved
Co-authored-by: Cooper Lees <[email protected]>
@harupy harupy requested a review from cooperlees December 9, 2024 00:55
@harupy
Copy link
Contributor Author

harupy commented Dec 9, 2024

@cooperlees Applied your suggestion! Could you take another look?

@cooperlees cooperlees merged commit 4fed293 into PyCQA:main Dec 9, 2024
7 checks passed
@cooperlees
Copy link
Collaborator

Many thanks for your contribution! Will try get a release out this week.

@harupy harupy deleted the fix-B028-args-kwargs branch December 9, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants