Skip to content

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

Open
ansley wants to merge 2 commits into
gh/"ansley"/2/basefrom
gh/"ansley"/2/head

Hidden character warning

The head ref may contain hidden characters: "gh/"ansley"/2/head"
Open

[F402] Warn on loop variable shadowing module name#272
ansley wants to merge 2 commits into
gh/"ansley"/2/basefrom
gh/"ansley"/2/head

Conversation

@amyreese amyreese left a comment

Copy link
Copy Markdown
Collaborator

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

amyreese commented Mar 8, 2023

Copy link
Copy Markdown
Collaborator

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

ansley commented Mar 14, 2023

Copy link
Copy Markdown
Author

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.

4 participants