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

Passing a -c configuration to rubocop hides the pending cops warnings #7855

Open
cover opened this issue Apr 6, 2020 · 1 comment
Open
Assignees
Labels

Comments

@cover
Copy link

cover commented Apr 6, 2020

Expected behavior

When rubocop is called by passing a configuration file (rubocop -c .rubocop.yml) it shows the pending cops warnings like it does when it's called without configuration file (rubocop).

Actual behavior

By passing the configuration file it's not showing any warning. I know it's using the .rubocop file in both cases because it's not showing the frozen string warning.

Steps to reproduce the problem

mkdir rubocop-bug
cd rubocop-bug
echo "source 'https://rubygems.org'\ngem 'rubocop', '0.81'" > Gemfile
echo "def test\n  raise Exception, 'Error message here'\nend" > test.rb
echo "Style/FrozenStringLiteralComment:\n  Enabled: false" > .rubocop.yml
bundle
rubocop
rubocop -c .rubocop.yml

Output

$ rubocop    
The following cops were added to RuboCop, but are not configured. Please set Enabled to either `true` or `false` in your `.rubocop.yml` file:
 - Lint/RaiseException (0.81)
 - Lint/StructNewOverride (0.81)
 - Style/HashEachMethods (0.80)
 - Style/HashTransformKeys (0.80)
 - Style/HashTransformValues (0.80)
For more information: https://docs.rubocop.org/en/latest/versioning/
Inspecting 2 files
..

2 files inspected, no offenses detected

$ rubocop -c .rubocop.yml
Inspecting 2 files
..

2 files inspected, no offenses detected

RuboCop version

0.81.0

Ruby version

2.7.0

@dvandersluis
Copy link
Member

@koic you were working on this at one point, want to pick it back up? 😁

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