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

Rubocop failure #763

Open
bj-mcduck opened this issue Sep 7, 2021 · 1 comment
Open

Rubocop failure #763

bj-mcduck opened this issue Sep 7, 2021 · 1 comment

Comments

@bj-mcduck
Copy link

bj-mcduck commented Sep 7, 2021

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/**/*'
@sds
Copy link
Owner

sds commented Feb 23, 2022

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.

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

No branches or pull requests

2 participants