Skip to content

Specify the plugin class name explicitly - #306

Merged
mgriffin merged 2 commits into
mainfrom
mgriffin/specify
May 27, 2025
Merged

Specify the plugin class name explicitly#306
mgriffin merged 2 commits into
mainfrom
mgriffin/specify

Conversation

@mgriffin

Copy link
Copy Markdown
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
@mgriffinmgriffin self-assigned this May 27, 2025
CopilotAI review requested due to automatic review settings May 27, 2025 15:06
@mgriffin
mgriffin requested a review from a team as a code ownerMay 27, 2025 15:06

CopilotAI left a comment

Copy link
Copy Markdown

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.

FileDescription
config/rails.ymlAdded plugin_class_name under rubocop-rails plugin
config/default.ymlAdded 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:

Comment threadconfig/rails.yml
Comment threadconfig/default.yml
@composerinteralia

Copy link
Copy Markdown
Member

Neat! I didn't know you could do that

@mgriffin
mgriffin merged commit e71daca into mainMay 27, 2025
@mgriffin
mgriffin deleted the mgriffin/specify branch May 27, 2025 17:10
Sign up for freeto 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.

4 participants

@mgriffin@composerinteralia@issyl0