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

feat(A005): support detecting a shadowing folder #125

Merged
merged 2 commits into from Apr 9, 2024

Conversation

asfaltboy
Copy link
Contributor

Package directories that are named the same as built-in modules can also cause the issue. This should handle both:

Given a directory with these files:

❯ eza -T temp/
drwxr-xr-x - asfaltboy  8 Apr 13:44  temp
drwxr-xr-x - asfaltboy  8 Apr 13:44 ├──  typing
.rw-r--r-- 0 asfaltboy  8 Apr 13:44 │  └──  __init__.py
.rw-r--r-- 0 asfaltboy 20 Feb 11:22 ├──  __init__.py
.rw-r--r-- 9 asfaltboy 19 Feb 14:57 └──  logging.py

Running flake8 with the plugin on this PR's branch, results in:

❯ flake8 ./temp/
./temp/logging.py:0:1: A005 the module is shadowing a Python builtin module "logging"
./temp/typing/__init__.py:0:1: A005 the module is shadowing a Python builtin module "typing"

fix #124

Copy link
Owner

@gforcada gforcada left a comment

Choose a reason for hiding this comment

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

Thanks! 🤩

Would you mind adding a change log entry? I will make a release right away then 😄

@gforcada gforcada merged commit 3890afb into gforcada:main Apr 9, 2024
7 checks passed
@gforcada
Copy link
Owner

gforcada commented Apr 9, 2024

@asfaltboy thanks!! 🤗

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.

A005 does not fire for packages
2 participants