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 compatibility with Rubocop 1.33.0 #43

Merged
merged 2 commits into from
Aug 5, 2022

Conversation

marcotc
Copy link
Contributor

@marcotc marcotc commented Aug 4, 2022

rubocop/rubocop@6b6d554 moved project_root from RuboCop::ConfigLoader.project_root to RuboCop::ConfigFinder.project_root, this breaks rubocop-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 on project_root. This will prevent users from installing newer versions of rubocop-packaging with an incompatible rubocop version.
It's also possible to support both RuboCop::ConfigLoader.project_root and RuboCop::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 latest rubocop-packaging to work with older rubocop 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.

@koic koic merged commit 0122e47 into utkarsh2102:master Aug 5, 2022
@koic
Copy link
Collaborator

koic commented Aug 5, 2022

Thanks!

@marcotc
Copy link
Contributor Author

marcotc commented Aug 5, 2022

Thank you for the super quick turnaround responding here, @koic! 🙇

@utkarsh2102
Copy link
Owner

Thanks a bunch, @marcotc, for the quick fix! Just cut a new release with credits; cf: https://github.com/utkarsh2102/rubocop-packaging/releases/tag/v0.5.2. ❤️

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.

None yet

3 participants