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

Add import shadowing rule #76

Merged
merged 1 commit into from
Apr 11, 2023
Merged

Add import shadowing rule #76

merged 1 commit into from
Apr 11, 2023

Conversation

anderseknert
Copy link
Member

Taken from OPA strict mode - we should have it too

Taken from OPA strict mode - we should have it too

Signed-off-by: Anders Eknert <anders@styra.com>

some i, identifier in _identifiers

identifier in array.slice(_identifiers, 0, i)
Copy link
Member

Choose a reason for hiding this comment

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

This is clever! I think it's generally the later imports which are the issue. However, for the sake of argument. Which line is the issue here?

import data.bar as foo
import data.foo

I'd make a case for line 1, not line 2 personally. But that might just be my take 🙂. Mostly playing devil's advocate here... not a blocker.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd say it's still the later line — that's the one shadowing the first, alias or not :)

@anderseknert anderseknert merged commit 780c1dc into main Apr 11, 2023
@anderseknert anderseknert deleted the import-shadows-import branch April 11, 2023 13:19
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.

None yet

2 participants