KEMBAR78
[Fix #11782] Move pending cops warning out of ConfigLoader by nobuyo · Pull Request #14341 · rubocop/rubocop · GitHub
Skip to content

Conversation

@nobuyo
Copy link
Contributor

@nobuyo nobuyo commented Jul 3, 2025

closes #11782

Previously, RuboCop::ConfigLoader emitted pending cops warnings as a side effect of loading configuration files. This caused unintended stdout output during tests and could interfere with CLI operations like --auto-gen-config.

This patch moves the responsibility for pending cops reporting to a dedicated PendingCopsReporter class. The CLI now explicitly invokes the reporter after loading configuration, ensuring that ConfigLoader remains a pure loader without user-facing output.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • 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.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

Previously, `RuboCop::ConfigLoader` emitted pending cops warnings as a side effect of loading configuration files.
This caused unintended stdout output during tests and could interfere with CLI operations like `--auto-gen-config`.

This patch moves the responsibility for pending cops reporting to a dedicated `PendingCopsReporter` class.
The CLI now explicitly invokes the reporter after loading configuration, ensuring that `ConfigLoader` remains a pure loader without user-facing output.
@bbatsov
Copy link
Collaborator

bbatsov commented Jul 7, 2025

The proposal looks reasonable to me. @jonas054 @koic Any thoughts?

@bbatsov bbatsov merged commit 9582c40 into rubocop:master Jul 8, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants