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

Fix a false positive for Minitest/EmptyLineBeforeAssertionMethods #197

Merged
merged 1 commit into from
Nov 11, 2022

Conversation

krishanbhasin-shopify
Copy link
Contributor

@krishanbhasin-shopify krishanbhasin-shopify commented Nov 9, 2022

Co-authored-by: Ryan Quanz [email protected]

Fixes #196

Minitest/EmptyLineBeforeAssertionMethods expected test blocks where the first line contained an assertion to have a newline above them. This isn't desired when, for example, the test is at the top of a class.

This PR fixes a false positive for Minitest/EmptyLineBeforeAssertionMethods when using an assertion method as the first line within a test block.

Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • 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.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

@krishanbhasin-shopify krishanbhasin-shopify force-pushed the master branch 4 times, most recently from a3ab098 to 8d3c8b6 Compare November 9, 2022 16:49
@krishanbhasin-shopify krishanbhasin-shopify changed the title Fix a false positive for \Minitest/EmptyLineBeforeAssertionMethods\ Fix a false positive for Minitest/EmptyLineBeforeAssertionMethods Nov 9, 2022
@krishanbhasin-shopify krishanbhasin-shopify marked this pull request as ready for review November 9, 2022 16:58
…ethods`

Addresses rubocop#196

Fix a false positive when using an assertion method as the first
line within a test block

Co-authored-by: Ryan Quanz <[email protected]>
@koic koic merged commit dca5659 into rubocop:master Nov 11, 2022
@koic
Copy link
Member

koic commented Nov 11, 2022

Thanks!

@koic
Copy link
Member

koic commented Nov 11, 2022

RuboCop Minitest 0.23.2 has been released.
https://github.com/rubocop/rubocop-minitest/releases/tag/v0.23.2

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.

Infinite Loop Between Minitest/EmptyLineBeforeAssertionMethods and Layout/EmptyLinesAroundClassBody
2 participants