Skip to content

Make rubocop-packs work as a RuboCop plugin#86

Merged
dduugg merged 2 commits intorubyatscale:mainfrom
jeromedalbert:pluginfy-rubocop-packs
Mar 6, 2026
Merged

Make rubocop-packs work as a RuboCop plugin#86
dduugg merged 2 commits intorubyatscale:mainfrom
jeromedalbert:pluginfy-rubocop-packs

Conversation

@jeromedalbert
Copy link
Contributor

Resolves #85.

This PR adds support for RuboCop's Plugin feature: rubocop/rubocop#13792

@jeromedalbert jeromedalbert force-pushed the pluginfy-rubocop-packs branch from 3992078 to 5c60c12 Compare March 23, 2025 20:05
@jeromedalbert jeromedalbert force-pushed the pluginfy-rubocop-packs branch from 5c60c12 to a2eb19a Compare March 23, 2025 20:19
@jeromedalbert jeromedalbert marked this pull request as ready for review March 23, 2025 20:22
@tim-gq
Copy link

tim-gq commented Mar 30, 2025

@jeromedalbert Would love to see this. Do your changes prevent it from working with older versions of rubocop, or is this backwards compatible?

@jeromedalbert
Copy link
Contributor Author

This is backwards compatible. People can use require in their rubocop.yml and it will still work, but a warning will be emitted.

@dduugg dduugg requested a review from a team March 5, 2026 17:53
Copy link
Contributor

@dduugg dduugg left a comment

Choose a reason for hiding this comment

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

Thanks for this! The migration from the old Inject monkey-patch to LintRoller::Plugin is a clean improvement and the implementation looks correct.

One minor nit: lib/rubocop/packs/plugin.rb uses # typed: false while the rest of the codebase uses typed: strict. Happy to take that as a follow-up if it's not straightforward to satisfy Sorbet here.

@dduugg dduugg merged commit fa6ae36 into rubyatscale:main Mar 6, 2026
0 of 7 checks passed
@jeromedalbert
Copy link
Contributor Author

If I remember correctly I had issues with typed: strict so I used # typed: false as a quick win. But I don't use Sorbet, so feel free to go ahead and improve on this!

@jeromedalbert jeromedalbert deleted the pluginfy-rubocop-packs branch March 6, 2026 18:29
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.

Pluginfy rubocop-packs

3 participants