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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new `Lint/EmptyExpression` cop #3680

Merged
merged 1 commit into from Oct 29, 2016

Conversation

Projects
None yet
2 participants
@Drenmi
Collaborator

Drenmi commented Oct 29, 2016

This is a very basic cop, that checks for empty expressions. It binds to the #on_begin callback, and so performs the check on the very lowest level possible.

Because it can appear literally where any expression can appear, we could have an almost unlimited number of tests for this, but I decided to add the most common cases for now. 馃槄


Before submitting the PR make sure the following are checked:

  • Wrote good commit messages.
  • Used the same coding conventions as the rest of the project.
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • All tests are passing.
  • The new code doesn't generate RuboCop offenses.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.
  • Updated cop documentation with rake generate_cops_documentation (required only when you've added a new cop or changed the configuration/documentation of an existing cop).
Add new `Lint/EmptyExpression` cop
This is a very basic cop, that checks for empty expressions. It binds to
the `#on_begin` callback, and so performs the check on the very lowest
level possible.

@bbatsov bbatsov merged commit 62d3c1b into rubocop-hq:master Oct 29, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Drenmi Drenmi deleted the Drenmi:feature/empty-expression-cop branch Dec 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment