-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Conversation
ee72832
to
bad37e7
Compare
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. |
Ah, that's a good point of view. RuboCop Minitest can be designed to provide a single cop that bundles 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 ][]) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
Please add this cop setting to config/default.yml. |
bad37e7
to
bc1f306
Compare
bc1f306
to
7331315
Compare
Thanks! |
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' |
There was a problem hiding this comment.
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.
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).and description in grammatically correct, complete sentences.
bundle exec rake default
. It executes all tests and RuboCop for itself, and generates the documentation.