-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat: module name shadowing #121
Conversation
06a3280
to
f2b1455
Compare
Hi @gforcada, hope you are doing good 👋 I have tested this PR's code manually with flake8, and it seems to work well. So, it's ready for your review. I left a few To-dos for things we may need to decide on before we merge the change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It all looks good, I started the GHA, let's see what's their opinion as well 🤞🏾 😄
I only have one small remark 😃
Regarding the todos:
|
+ update test_stdin to make use of the updated helper
and test that using the option works as expected
f2b1455
to
58b8527
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! thanks! 🙇🏾 😄
flake8 got a new warning about a module name shadowing a builtin module: gforcada/flake8-builtins#121 Probably would have been safe enough to ignore it. But I don't think moving it is that hard anyway. Hopefully I didn't miss anything!
Introduces check A005, that returns an error if a scanned filename matches a module name in the list of known builtin/stdlib python modules. An example of an error:
We use
sys.stdlib_module_names
from python 3.10 as it contains all known module names (for all platforms), and on older versions, we fall back tosys.builtin_module_names
which contains module names for the used python executable's platform.Todos