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 cop Minitest/RefuteNil #11

Merged
merged 1 commit into from Sep 6, 2019
Merged

Conversation

tejasbubane
Copy link
Contributor

  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • 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.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.
  • Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.

@tejasbubane
Copy link
Contributor Author

I created a separate cop for now but should we have separate refute cops or have single cop which handles refute as well? This will apply to almost all other cops.

@koic
Copy link
Member

koic commented Sep 6, 2019

Ah, that's a good point of view. RuboCop Minitest can be designed to provide a single cop that bundles refute_*.

However, a design that provides individual cops along The Minitest Style Guide may be fine. So, Minitest is a simple API and expects a limited number of style rules.

I think that it may be simple if a rule of Minitest Style Guide and a cop is mapped. Each cop can have a reference to a rule of The Minitest Style Guide.

Cc @rubocop-hq/rubocop-core

@@ -1,5 +1,7 @@
## master (unreleased)

* [#11](https://github.com/rubocop-hq/rubocop-minitest/pull/11): Add new `Minitest/RefuteNil` cop. ([@tejasbubane ][])
Copy link
Member

Choose a reason for hiding this comment

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

Can you add ### New features category?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

@koic
Copy link
Member

koic commented Sep 6, 2019

Please add this cop setting to config/default.yml.

@koic koic merged commit 04e9a82 into rubocop:master Sep 6, 2019
@koic
Copy link
Member

koic commented Sep 6, 2019

Thanks!

@tejasbubane tejasbubane deleted the refute-nil-cop branch September 6, 2019 14:36
koic added a commit that referenced this pull request Sep 6, 2019
Description: 'Check if your test uses `refute_nil` instead of `refute_equal(nil, something)`.'
StyleGuide: 'https://github.com/rubocop-hq/minitest-style-guide#refute-nil'
Enabled: true
VersionAdded: '0.1.1'
Copy link
Member

@koic koic Sep 6, 2019

Choose a reason for hiding this comment

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

I overlooked the version and updated it by b9c8da6. FYI, Minor version will be bumped when new cop is added.

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

2 participants