Skip to content

Check for empty skip_file_prefixes in B028 #510

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

Open
dylwil3 opened this issue May 12, 2025 · 1 comment
Open

Check for empty skip_file_prefixes in B028 #510

dylwil3 opened this issue May 12, 2025 · 1 comment

Comments

@dylwil3
Copy link

dylwil3 commented May 12, 2025

As of #503 (cf #497) the following emits no lint:

cat example.py
import warnings

warnings.warn("test", skip_file_prefixes=())uvx --with git+https://github.com/PyCQA/flake8-bugbear flake8 --select B028 check example.pyecho $?
0

But it probably should: the stacklevel is only set to at least 2 if there is at least one prefix given. Of course, the user may pass in a reference to some unknown tuple, in which case it's probably better to skip the lint - but if they explicitly pass an empty tuple, then it makes sense to still emit the lint.

On the other hand I understand if this is overly pedantic and unlikely, so feel free to close the issue as unplanned!

@JelleZijlstra
Copy link
Collaborator

I'd accept a PR but this feels unlikely to matter in practice.

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

No branches or pull requests

2 participants