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 autocorrect to Rails/AssertEmptyLiteral cop #85

Merged
merged 1 commit into from
Jul 1, 2020

Conversation

fatkodima
Copy link
Contributor

  1. Added autocorrection
  2. Also this cop was not implemented correctly as it should check against assert_equal([], something), not assert([], something) - changed that

For reference: http://docs.seattlerb.org/minitest/Minitest/Assertions.html#method-i-assert

@fatkodima fatkodima force-pushed the assert-empty-literal-autocorrection branch from 189b85f to adf63c9 Compare July 1, 2020 14:09
@fatkodima
Copy link
Contributor Author

Rebased.

@koic
Copy link
Member

koic commented Jul 1, 2020

  1. Added autocorrection
  2. Also this cop was not implemented correctly as it should check against assert_equal([], something), not assert([], something) - changed that

I think that unsafe auto-correction could be added. But the assert method has been intentionally used.
#32

I'm worried about changing behaviour for bad case.

@fatkodima fatkodima force-pushed the assert-empty-literal-autocorrection branch from adf63c9 to b9042de Compare July 1, 2020 14:42
@fatkodima
Copy link
Contributor Author

But the assert method has been intentionally used. #32

Aaaah, got it.

Reverted the second part:

Also this cop was not implemented correctly as it should check against assert_equal([], something), not assert([], something) - changed that

Marked unsafe autocorrection.

@koic koic merged commit 2d981c2 into rubocop:master Jul 1, 2020
@koic
Copy link
Member

koic commented Jul 1, 2020

Thank you!

koic added a commit to koic/rubocop-minitest that referenced this pull request Oct 2, 2021
This PR marks `Minitest/AssertEmptyLiteral` as safe auto-correction.
Introduced as unsafe auto-correction in rubocop#85, but now safe auto-correction
with changes in rubocop#118.
@fatkodima fatkodima deleted the assert-empty-literal-autocorrection branch January 16, 2023 13:06
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.

2 participants