-
-
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
[Fix #157] Add new Minitest/EmptyLineBeforeAssertionMethods
cop
#163
[Fix #157] Add new Minitest/EmptyLineBeforeAssertionMethods
cop
#163
Conversation
config/default.yml
Outdated
@@ -99,6 +99,11 @@ Minitest/AssertWithExpectedArgument: | |||
Safe: false | |||
VersionAdded: '0.11' | |||
|
|||
Minitest/EmptyLinesBeforeAssertionMethod: |
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.
Would EmptyLineBeforeAssertionMethod
(no plural) be better?
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.
Yeah, I was wondering about the name of this cop. I've renamed it to Minitest/EmptyLineBeforeAssertionMethods
.
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.
Thinking about this again, I wonder if talking about line/lines is too specific, and the name should better convey the intention.
This is closely tied to Arrange-Act-Assert or the Four Phase Test.
I can't think of a good name yet, but maybe something along the lines of SeparateAssertionPhase
or DistinctAssertions
...
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.
@andyw8 I was second thoughts about this cop name. But I will name it as Minitest/EmptyLineBeforeAssertionMethods
because the RuboCop core has many similar names.
The attractive candidate SeparateAssertionPhase
has been included as the cop document description.
Minitest/EmptyLinesBeforeAssertionMethod
copMinitest/EmptyLinesBeforeAssertionMethods
cop
e2481fb
to
7a9c3d8
Compare
7a9c3d8
to
c0d5f54
Compare
Minitest/EmptyLinesBeforeAssertionMethods
copMinitest/EmptyLinesBeforeAssertionMethod
cop
Minitest/EmptyLinesBeforeAssertionMethod
copMinitest/EmptyLineBeforeAssertionMethod
cop
c0d5f54
to
a94e790
Compare
Minitest/EmptyLineBeforeAssertionMethod
copMinitest/EmptyLineBeforeAssertionMethods
cop
5304493
to
e541e62
Compare
test/rubocop/cop/minitest/empty_line_before_assertion_methods_test.rb
Outdated
Show resolved
Hide resolved
Fixes rubocop#157. This PR adds new `Minitest/EmptyLineBeforeAssertionMethods` cop. This cop enforces empty line before assertion method because it separates assertion phase. ```ruby # bad do_something assert_equal(expected, actual) # good do_something assert_equal(expected, actual) ```
e541e62
to
6d8a9e7
Compare
@koic Awesome! 🥇 |
Fixes #157.
This PR adds new
Minitest/EmptyLineBeforeAssertionMethods
cop.This cop enforces empty line before assertion method.
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.