Fix compatibility with Rubocop 1.33.0 #43
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
rubocop/rubocop@6b6d554 moved
project_root
fromRuboCop::ConfigLoader.project_root
toRuboCop::ConfigFinder.project_root
, this breaksrubocop-packaging
.This PR performs the required code changes to reflect this method move.
The approach I took was to set the minimum required Rubocop version to
1.33.0
and perform a "hard" move onproject_root
. This will prevent users from installing newer versions ofrubocop-packaging
with an incompatiblerubocop
version.It's also possible to support both
RuboCop::ConfigLoader.project_root
andRuboCop::ConfigFinder.project_root
at the same time (e.g.defined?(RuboCop::ConfigFinder.project_root) ? RuboCop::ConfigFinder.project_root : RuboCop::ConfigLoader.project_root
), but I'm not sure if that's a better solution: it comes down to how important it is for the latestrubocop-packaging
to work with olderrubocop
versions. I can make this change if needed.Also, the second commit, "Fix lint issues", is due to rubocop lint failures due to the upgrade to
1.33.0
. I added them to have a clean CI in this branch, but are technically unrelated.