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 new Lint/EmptyConditionalBody cop #8341

Merged
merged 1 commit into from Aug 5, 2020

Conversation

fatkodima
Copy link
Contributor

This cop checks for empty bodies in if/elsif/unless branches.
This is in addition to existent Lint/EmptyWhen cop.

Copy link
Contributor

@rrosenblum rrosenblum left a comment

Choose a reason for hiding this comment

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

It looks like there are some test failures on Ruby head. Not sure if this is unique to this PR or if it is happening everywhere.

else
captured_values = uri_regexp_without_argument?(node)
end
captured_values =
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm always happy when a new cop catches weird code within our own source code. Really helps to confirm that the cop is useful.

@bbatsov
Copy link
Collaborator

bbatsov commented Aug 5, 2020

The changes look good, but your branch has to be rebased on top of the current master branch due to merge conflicts.

@bbatsov bbatsov merged commit f91df3e into rubocop:master Aug 5, 2020
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

3 participants