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

[Feature Request] Detect duplicate requires #176

Closed
jwoertink opened this issue Dec 24, 2020 · 2 comments
Closed

[Feature Request] Detect duplicate requires #176

jwoertink opened this issue Dec 24, 2020 · 2 comments
Labels

Comments

@jwoertink
Copy link

This is probably a rare case, but I just found in lucky we had some duplicate requires in the same file.

require "./thing"
require "./stuff"
require "./thing"  # <-- would be neat if Ameba caught this
require "./other_stuff"
@veelenga
Copy link
Member

veelenga commented Dec 24, 2020

Nice one. I wonder why the compiler doesn’t detect this

@jwoertink
Copy link
Author

That's a good point. I think it just returns false if it's already been required. So maybe the compiler doesn't know the difference between "I can't require this" and "I've already required this"? ... though, I guess if it couldn't require it, it would just raise a compile-time error 🤔

veelenga added a commit that referenced this issue Jan 17, 2021
veelenga added a commit that referenced this issue Jan 17, 2021
veelenga added a commit that referenced this issue Jan 17, 2021
veelenga added a commit that referenced this issue Jan 17, 2021
@Sija Sija added the feature label Jan 17, 2021
@Sija Sija added rule and removed feature labels Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants