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

Use rubocop-minitest to lint test suite #2556

Closed
wants to merge 1 commit into from
Closed

Use rubocop-minitest to lint test suite #2556

wants to merge 1 commit into from

Conversation

dmarcoux
Copy link
Contributor

@dmarcoux dmarcoux commented Sep 3, 2022

Summary

Following up on the issue #2526 and this comment from @stefannibrasil, RuboCop is now linting the test suite.

Other Information

All offenses were auto-corrected with bundle exec rubocop -a.

In total, there were 1824 offenses! While this is huge and hard to review, I see a benefit in being consistent in how tests are written. This is now enforced by RuboCop.

All offenses were auto-corrected with `bundle exec rubocop -a`.

In total, there were 1824 offenses!
@dmarcoux
Copy link
Contributor Author

dmarcoux commented Sep 4, 2022

I didn't realize that somehow the auto-correction turning assert into assert_match statements is wrong. Since this needs to be done in hundreds of files, I will close this PR. Another approach needs to be taken.

@dmarcoux dmarcoux closed this Sep 4, 2022
@dmarcoux dmarcoux deleted the rubocop-minitest branch September 4, 2022 11:27
koic added a commit to koic/rubocop-minitest that referenced this pull request Sep 6, 2022
This PR fixes an incorrect autocorrect for `Minitest/AssertMatch`
when `assert` with `match` and RHS is a regexp literal.

A regular expression literal must be the first argument to `assert_match`.
`TypeError: no implicit conversion of Regexp into String` will occur if it is
passed as the second argument.

```ruby
assert_match(object, /regexp/) #=> TypeError: no implicit conversion of Regexp into String
```

This issue was found on faker-ruby/faker#2556.
@koic
Copy link
Member

koic commented Sep 6, 2022

This is a RuboCop Minitest bug. I'm working on this. And after RuboCop Minitest release, I'll take care of it.
rubocop/rubocop-minitest#181

koic added a commit that referenced this pull request Sep 8, 2022
@koic
Copy link
Member

koic commented Sep 8, 2022

The issue has been resolved by efedb39.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants