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

[Fix #7745] Suppress pending cop warnings when department is disabled #7758

Conversation

koic
Copy link
Member

@koic koic commented Feb 25, 2020

Fixes #7745.

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

Context

% rubocop -V
0.80.0 (using Parser 2.7.0.2, running on ruby 2.7.0 x86_64-darwin17)
% cat .rubocop.yml
Style:
  Enabled: false

Before

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

% 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.

% bundle exec rubocop
Inspecting 0 files

0 files inspected, no offenses detected

Before submitting the PR make sure the following are checked:

  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.

…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
```
@koic koic force-pushed the suppress_pending_cop_warnings_when_deaprtment_is_disabled branch from 2caa627 to d0321b7 Compare February 26, 2020 04:20
@bbatsov bbatsov merged commit 7cce1fe into rubocop:master Feb 26, 2020
@bbatsov
Copy link
Collaborator

bbatsov commented Feb 26, 2020

Nicely done! 🙇

@koic koic deleted the suppress_pending_cop_warnings_when_deaprtment_is_disabled branch February 26, 2020 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants