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

Fix incompatibility with RuboCop extensions that modify Include/Exclude for cops #34

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

Earlopain
Copy link
Contributor

Consider this:

  • A different extension (like rubocop-erb) gets loaded first and modifies a cops Exclude list
  • rubocop-md gets loaded and also modifies the same cops exclude list
  • rubocop-md discards the changes from rubocop-erb because the configs aren't being properly merged

For example, when adding rubocop-erb to the rails repository there are about 1.5k offenses. With this change there are only about 10% since the excludes from rubocop-erb are properly applied.

I tried adding a test for this but couldn't figure out how to do that properly.

CI for ruby-head is failing until minitest releases a new version, see minitest/minitest@5f5c211

…de for cops

Consider this example:
* A different extension (like rubocop-erb) gets loaded first and modifies a cops Exclude list
* rubocop-md gets loaded and also modifies the same cops exclude list
* rubocop-md discards the changes from rubocop-erb because the configs aren't being merged
@palkan
Copy link
Collaborator

palkan commented Jan 11, 2024

Thanks!

@palkan palkan merged commit 8ade436 into rubocop:master Jan 11, 2024
11 of 12 checks passed
@Earlopain Earlopain deleted the default-config-inherit branch January 11, 2024 17:25
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.

2 participants