forked from rodjek/puppet-lint
-
Notifications
You must be signed in to change notification settings - Fork 19
(MAINT) Rubocop updates #54
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ac64181 to
a1b0d4a
Compare
|
It looks like only the CLA is running here and the other checks aren't |
|
#53 fixes that 🙂 |
Previously load_from_gems contained nested loops and block continuation. It was hard to read and probably not that efficient when processing many files. This commit cleans the method up by splitting the operations out in to three distinct operations, hopefully simplifying the code slightly. In addition, the Rubocop fixes have also been applied in this commit.
Prior to this commit there was some code duplication between the 140char and 80char checks. This PR breaks out the core logic for these checks in to it's own class. This reduces duplication and also allows for a configurable line length. In the future this could be expanded to allow the user to specify their desired line length from config or a flag.
a1b0d4a to
dfa3b47
Compare
|
since this is a pretty big PR, could you add a description detailing what the PR achieves? And add a label? |
|
My bad @GSPatton |
david22swan
approved these changes
Oct 6, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The aim of this PR is to implement the suggestions provided by rubocop now that the TargetVersion has been bought inline with the minimum required ruby version.
This PR only focuses on code in
liband aims to ensure that the spec tests remain green.There will be a followup PR that contains fixes for code in
spec.Additionally the following changes have been added to the PR as optional extras.
Refactor load_from_gems
Previously load_from_gems contained nested loops and block continuation. It was hard to read and probably not that efficient when processing many files.
This PR adds a commit that cleans the method up by splitting the operations out in to three distinct operations, hopefully simplifying the code slightly.
Refactor line length check
Prior to this PR there was some code duplication between the 140char and 80char line length checks.
This PR contains a commit that breaks out the core logic for these checks in to its own class.
This reduces duplication and also allows for a configurable line length.
In the future this could be expanded to allow the user to specify their desired line length from config or a flag.