■ Situation Make a simple fix for staff migration Conflict occurs Update your local main branch git merge Do the main branch and resolve the conflict I got some errors in "bundle exec rubocop", so I ran "bundle exec rubocop -a" I do "bundle exec rubocop", but the following error is not resolved
console
# bundle exec rubocop
app/models/user.rb:47:3: C: Rails/UniqueValidationWithoutIndex: Uniqueness validation should be with a unique index.
validates :email, presence: true, length: { maximum: 70 }, ...
However, I haven't touched this file this time, so I don't know the cause.
As a result, we verified and solved it by the following method.
・ Test execution of main branch just in case → 0 errors ・ Therefore, it is predicted that "bundle exec rubocop -a" may be doing something. ・ As a result of checking, it was found that the description (comment) that ignores the rubocop warning was automatically deleted.
I returned the deleted description and got 0 errors!
Regarding the description that ignores the rubocop warning I think the following will be helpful. (Maybe it's old?)
https://qiita.com/tbpgr/items/a9000c5c6fa92a46c206
Recommended Posts