overcommit
overcommit copied to clipboard
Rubocop failure
I'm trying to add overcommit to run rubocop, but I'm getting a rubocop error on a file that it shouldn't even be run on. The file in question seems to be related to auto generated overcommit things, so I'm hoping I can get some guidance here.
I'm getting the following error:
Offenses:
.git/COMMIT_EDITMSG:1:1: C: [Correctable] Style/FrozenStringLiteralComment: Missing frozen string literal comment.
run rubocop
^
1 file inspected, 1 offense detected, 1 offense auto-correctable
My configs are the following:
# .overcommit_gems.rb
source 'https://rubygems.org'
ruby '2.7.3'
gem 'overcommit'
gem 'rubocop', '~> 1.20', require: false
gem 'rubocop-performance', require: false
gem 'rubocop-rails', require: false
gem 'rubocop-rspec', require: false
# .overcommit.yml
verify_signatures: false
gemfile: .overcommit_gems.rb
CommitMsg:
Rubocop:
enabled: true
on_warn: fail
problem_on_unmodified_line: ignore
command: ['bundle', 'exec', 'rubocop']
# .rubocop.yml
require:
- rubocop-performance
- rubocop-rails
- rubocop-rspec
inherit_from:
# not important ...
AllCops:
NewCops: enable
Exclude:
- 'db/migrate/**/*'
- 'db/schema.rb'
- 'config/**/*'
- 'script/**/*'
- 'bin/{rails,rake,yarn}'
- 'features/**/*'
- '.git/**/*'
Sorry for the delay in response.
It's not clear to me why you're seeing this behavior. If you have a minimum repository reproduces the issue, it would help explain whether there is a configuration problem or a bug. My guess here (given I have never seen this myself) is a configuration problem.