Skip to content

fix false positive in useless-break when a label follows a break #1286

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

Merged
merged 4 commits into from
Apr 4, 2025

Conversation

semihbkgr
Copy link
Contributor

Closes #1281

@semihbkgr semihbkgr changed the title fix false positive in useless-break when a label follows a break statement fix false positive in useless-break when a label follows a break Apr 2, 2025
Copy link
Collaborator

@chavacava chavacava left a comment

Choose a reason for hiding this comment

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

Hi @semihbkgr thank you for the PR !
IMO we can simplify the implementation of the rule by raising a failure only if break is the last statement in a case body.

@semihbkgr semihbkgr requested a review from chavacava April 3, 2025 16:02
@chavacava chavacava merged commit f4e39a7 into mgechev:master Apr 4, 2025
8 checks passed
@chavacava
Copy link
Collaborator

Thanks @semihbkgr !

mfederowicz pushed a commit to mfederowicz/revive that referenced this pull request Apr 18, 2025
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.

useless-break flags necessary break in case
2 participants