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

[F402] Warn on loop variable shadowing module name #272

Open
wants to merge 2 commits into
base: gh/"ansley"/2/base
Choose a base branch
from

Conversation

Copy link
Member

@amyreese amyreese left a comment

Choose a reason for hiding this comment

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

Needs formatting fixes (make format or hatch run lint:fix).

@amyreese
Copy link
Member

amyreese commented Mar 8, 2023

I think we need more variety of test cases, covering things like loops with multiple elements (or deep names), as well as some validating things like import a.b where a is the name that might be shadowed, but b isn't. Take a look at upstream pyflakes tests (search for "shadow" to find instances), and see what other cases we can cover from their examples.

@ansley
Copy link
Author

ansley commented Mar 14, 2023

I didn't see much in the pyflakes project (searched "shadow" and a few other keywords), but I did add more tests!

@ansley ansley changed the title [F402] Warn on module name shadowing [F402] Warn on loop variable shadowing module name Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. lint rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants