Skip to content

New cops information is printed many times when --regenerate-todo #11782

@nobuyo

Description

@nobuyo

On bundle exec rubocop --regenerate-todo, new cops information printed so many times like below:

The following cops were added to RuboCop, but are not configured. Please set Enabled to either `true` or `false` in your `.rubocop.yml` file.

Please also note that you can opt-in to new cops by default by adding this to your config:
  AllCops:
    NewCops: enable

Gemspec/DeprecatedAttributeAssignment: # new in 1.30
  Enabled: true

...

  Enabled: true
RSpec/Rails/InferredSpecType: # new in 2.14
  Enabled: true
RSpec/Rails/MinitestAssertions: # new in 2.17
  Enabled: true
RSpec/Rails/TravelAround: # new in 2.19
  Enabled: true
For more information: https://docs.rubocop.org/rubocop/versioning.html
The following cops were added to RuboCop, but are not configured. Please set Enabled to either `true` or `false` in your `.rubocop.yml` file.

Please also note that you can opt-in to new cops by default by adding this to your config:
  AllCops:
    NewCops: enable

Gemspec/DeprecatedAttributeAssignment: # new in 1.30
  Enabled: true
Gemspec/DevelopmentDependencies: # new in 1.44
  Enabled: true

...

RSpec/Rails/InferredSpecType: # new in 2.14
  Enabled: true
RSpec/Rails/MinitestAssertions: # new in 2.17
  Enabled: true
RSpec/Rails/TravelAround: # new in 2.19
  Enabled: true
For more information: https://docs.rubocop.org/rubocop/versioning.html
Created .rubocop_todo.yml.

Expected behavior

RuboCop prints the information just one time.

Actual behavior

RuboCop prints the information many time.

Steps to reproduce the problem

Minimum conditions to reproduce it have not been investigated but just run rubocop --regenerate-todo without NewCops: enabled config I believe.

RuboCop version

Include the output of rubocop -V or bundle exec rubocop -V if using Bundler.
If you see extension cop versions (e.g. rubocop-performance, rubocop-rspec, and others)
output by rubocop -V, include them as well. Here's an example:

$ [bundle exec] rubocop -V
1.48.1 (using Parser 3.2.1.1, rubocop-ast 1.28.0, running on ruby 3.1.2) [arm64-darwin21]
  - rubocop-performance 1.16.0
  - rubocop-rails 2.18.0
  - rubocop-rspec 2.19.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions