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

@fatkodima fatkodima commented Jul 14, 2020

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

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 =

This comment has been minimized.

@rrosenblum

rrosenblum Jul 15, 2020
Contributor

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 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.

@fatkodima fatkodima force-pushed the fatkodima:empty-conditional-body-cop branch from 7a3c4be to 85bcc65 Aug 5, 2020
@bbatsov bbatsov merged commit f91df3e into rubocop-hq:master Aug 5, 2020
25 of 26 checks passed
25 of 26 checks passed
windows 2.4
Details
windows 2.5
Details
windows 2.6
Details
windows 2.7
Details
windows mingw
Details
ci/circleci: cc-upload-coverage CircleCI is running your tests
Details
ci/circleci: cc-setup Your tests passed on CircleCI!
Details
ci/circleci: documentation-checks Your tests passed on CircleCI!
Details
ci/circleci: jruby-9.2-ascii_spec Your tests passed on CircleCI!
Details
ci/circleci: jruby-9.2-rubocop Your tests passed on CircleCI!
Details
ci/circleci: jruby-9.2-spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.4-ascii_spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.4-rubocop Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.4-spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.5-ascii_spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.5-rubocop Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.5-spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.6-ascii_spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.6-rubocop Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.6-spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.7-ascii_spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.7-rubocop Your tests passed on CircleCI!
Details
ci/circleci: ruby-2.7-spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-head-ascii_spec Your tests passed on CircleCI!
Details
ci/circleci: ruby-head-rubocop Your tests passed on CircleCI!
Details
ci/circleci: ruby-head-spec Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.