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

Invalid warning of unconfigured cops on new cops for Style/HashEachMethods, Style/HashTransformKeys, Style/HashTransformValues #7745

Closed
csalvato opened this issue Feb 22, 2020 · 2 comments · Fixed by #7758
Labels

Comments

@csalvato
Copy link

I recently updated to rubocop 0.80.0 and am now seeing inaccurate warnings.

In my .rubocop.yml, I have the following configuration:

Style:
  Enabled: false

But I am seeing a warning that I need to either enable or disable these cops:

The following cops were added to RuboCop, but are not configured. Please set Enabled to either `true` or `false` in your `.rubocop.yml` file:
 - Style/HashEachMethods
 - Style/HashTransformKeys
 - Style/HashTransformValues
Inspecting 82 files
..................................................................................

Expected behavior

Not present a warning for Style/HashEachMethods, Style/HashTransformKeys and Style/HashTransformValues when I disable all Stylecops.

Actual behavior

Seeing a warning for these new cops when all Style cops are disabled.

Steps to reproduce the problem

  1. Install rubocop
  2. In .rubocop.yml disable all Style cops
  3. Run rubocop
  4. Observe warning

RuboCop version

$ rubocop -V
0.80.0 (using Parser 2.7.0.2, running on ruby 2.6.5 x86_64-darwin19)
@pocke pocke added the bug label Feb 22, 2020
@geniou
Copy link
Contributor

geniou commented Feb 24, 2020

Have the same problem here.

@koic
Copy link
Member

koic commented Feb 25, 2020

Thanks for the feedback. I opened the PR #7758.

koic added a commit to koic/rubocop that referenced this issue Feb 26, 2020
…isabled

Fixes rubocop#7745.

This PR suppresses a pending cop warnings when pending cop's
department is disabled.

## Context

```console
% rubocop -V
0.80.0 (using Parser 2.7.0.2, running on ruby 2.7.0 x86_64-darwin17)
```

```yaml
% cat .rubocop.yml
Style:
  Enabled: false
```

## Before

The following pending cop warning is displayed for disabled Style department.

```console
% bundle exec 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:
 - Style/HashEachMethods
 - Style/HashTransformKeys
 - Style/HashTransformValues
Inspecting 0 files

0 files inspected, no offenses detected
```

## After

A pending cop warning is not displayed for disabled Style department.

```console
% bundle exec rubocop
Inspecting 0 files

0 files inspected, no offenses detected
```
bbatsov pushed a commit that referenced this issue Feb 26, 2020
Fixes #7745.

This PR suppresses a pending cop warnings when pending cop's
department is disabled.

## Context

```console
% rubocop -V
0.80.0 (using Parser 2.7.0.2, running on ruby 2.7.0 x86_64-darwin17)
```

```yaml
% cat .rubocop.yml
Style:
  Enabled: false
```

## Before

The following pending cop warning is displayed for disabled Style department.

```console
% bundle exec 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:
 - Style/HashEachMethods
 - Style/HashTransformKeys
 - Style/HashTransformValues
Inspecting 0 files

0 files inspected, no offenses detected
```

## After

A pending cop warning is not displayed for disabled Style department.

```console
% bundle exec rubocop
Inspecting 0 files

0 files inspected, no offenses detected
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants