Skip to content
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

Instantiate Object-type lint_roller plugins correctly #557

Merged
merged 3 commits into from
May 1, 2023

Conversation

searls
Copy link
Contributor

@searls searls commented May 1, 2023

We were instantiating configuration objects from plugins using RuboCop::Config.new instead of RuboCop::Config.create, which ended up causing subtle differences in how AllCops was being handled when merging plugins. Namely, it resulted in the inclusion of any such plugin as disabling all previously-defined cops, which is not what we'd want. (Including a single empty object plugin in your config will effectively disable every built-in cop, which isn't super good).

It still feels like there's more underlying trouble here around AllCops option DisabledByDefault which was added in 1.28.0, but this will fix the immediate and urgent issue.

Fixes standardrb/standard-rails#4

searls added 3 commits May 1, 2023 10:03
By supplying a path and calling Config.create, plugins that publish an :object type rules config will correctly merge in AllCops settings, such that everything seems to work.

Fixes: standardrb/standard-rails#4

This breaks a lot of tests and emits a lot of warnings, so we still have to work through those
The reason this covers the problem is that it demonstrates the base configuration is still intact even though an object-type lint_roller plugin is also active.
This still emits a bunch of warnings, which sucks.
@searls searls merged commit 76cc341 into main May 1, 2023
@searls searls deleted the fix-plugin-merging branch May 1, 2023 14:19
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.

Adding standard-rails as a plugin seems to turn off most/all standard rules
1 participant