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 empty_loop lint #510

Merged
merged 2 commits into from
Apr 22, 2023
Merged

Add empty_loop lint #510

merged 2 commits into from
Apr 22, 2023

Conversation

chriscerie
Copy link
Collaborator

@chriscerie chriscerie commented Apr 19, 2023

Closes #511.

This also lints for loops not involving tables, like

while true do end

@Kampfkarren
Copy link
Owner

This is fine, but it doesn't close #509. The bug I ran into there was I had a table, never did anything with it that would have led it to insert anything, then tried to loop over it, which would never have worked and we could statically analyze it.

@chriscerie
Copy link
Collaborator Author

This is fine, but it doesn't close #509. The bug I ran into there was I had a table, never did anything with it that would have led it to insert anything, then tried to loop over it, which would never have worked and we could statically analyze it.

Ah I misunderstood the issue. I created a new issue to track this.

@Kampfkarren Kampfkarren merged commit fb61214 into Kampfkarren:main Apr 22, 2023
@Kampfkarren
Copy link
Owner

Thanks!

@chriscerie chriscerie deleted the empty-loop branch April 22, 2023 21:48
Kampfkarren pushed a commit that referenced this pull request Apr 24, 2023
This fixes #510 that didn't add docs to `SUMMARY.md` and #507 that
didn't register the lint in `lib.rs`. That was my bad.
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.

Warn against empty loop
2 participants