Skip to content

Specify the plugin class name explicitly #306

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

Merged
merged 2 commits into from
May 27, 2025
Merged

Specify the plugin class name explicitly #306

merged 2 commits into from
May 27, 2025

Conversation

mgriffin
Copy link
Contributor

This allows rubocop to be run in bundler standalone mode. Without specifying the plugin class name, rubocop errors out with:

Error: Failed to load plugin rubocop-performance because the corresponding plugin class could not be determined for instantiation.

This is because it's trying to load the gem to find the name, but is unable to.

Setting the class name doesn't affect running rubocop through bundler, it will still work properly

This allows rubocop to be run in bundler standalone mode. Without
specifying the plugin class name, rubocop errors out with:

> Error: Failed to load plugin `rubocop-performance` because the corresponding plugin class could not be determined for instantiation.

This is because it's trying to load the gem to find the name, but is
unable to.

Setting the class name doesn't affect running rubocop through bundler,
it will still work properly
@mgriffin mgriffin self-assigned this May 27, 2025
@Copilot Copilot AI review requested due to automatic review settings May 27, 2025 15:06
@mgriffin mgriffin requested a review from a team as a code owner May 27, 2025 15:06
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds explicit plugin_class_name entries for RuboCop plugins so they can be loaded in bundler standalone mode without lookup errors.

  • Specify RuboCop::Rails::Plugin for rubocop-rails in config/rails.yml
  • Specify RuboCop::Performance::Plugin for rubocop-performance in config/default.yml

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
config/rails.yml Added plugin_class_name under rubocop-rails plugin
config/default.yml Added plugin_class_name under rubocop-performance
Comments suppressed due to low confidence (1)

config/default.yml:8

  • Consider adding a CI test that invokes RuboCop in bundler standalone mode to verify plugin loading with the explicit plugin_class_name, preventing future regressions.
+  - rubocop-performance:

@composerinteralia
Copy link
Member

Neat! I didn't know you could do that

@mgriffin mgriffin merged commit e71daca into main May 27, 2025
10 checks passed
@mgriffin mgriffin deleted the mgriffin/specify branch May 27, 2025 17:10
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.

3 participants