Open
Conversation
Merged
ekohl
reviewed
Apr 9, 2025
Contributor
ekohl
left a comment
There was a problem hiding this comment.
Just some things that jumped out to me.
Comment on lines
+15
to
+19
| class_name = if is_a? Class | ||
| name | ||
| else | ||
| self.class.name | ||
| end |
Contributor
There was a problem hiding this comment.
Perhaps even reduce it to a ternary
Suggested change
| class_name = if is_a? Class | |
| name | |
| else | |
| self.class.name | |
| end | |
| class_name = is_a?(Class) ? name : self.class.name |
| if path !~ /\A#{Regexp.escape destdir}/ | ||
| raise PuppetForge::InvalidPathInPackageError, :entry_path => path, :directory => destdir | ||
| end | ||
| return if /\A#{Regexp.escape destdir}/.match?(path) |
Contributor
There was a problem hiding this comment.
Isn't this equal to
Suggested change
| return if /\A#{Regexp.escape destdir}/.match?(path) | |
| return path.start_with?(destdir) |
|
|
||
| def orm_resp_item(json_response) | ||
| json_response.each do |key, value| | ||
| json_response.each do |key, _value| |
Contributor
There was a problem hiding this comment.
Suggested change
| json_response.each do |key, _value| | |
| json_response.each_key do |key| |
Comment on lines
+157
to
158
| param_hash = {} | ||
| params.each do |param| |
Contributor
There was a problem hiding this comment.
This could also be
param_hash = params.to_h { |param| param.split('=') }| def to_json(*_args) | ||
| data = @data.dup.merge('dependencies' => dependencies) | ||
|
|
||
| contents = data.keys.map do |k| |
Contributor
There was a problem hiding this comment.
I think rubocop-performance should catch this and iterate on the pair
Suggested change
| contents = data.keys.map do |k| | |
| contents = data.map do |k, v| |
| else | ||
| source_uri = URI.parse("http://#{data['source']}") | ||
| end | ||
| source_uri = if %r{://}.match?(data['source']) |
Contributor
There was a problem hiding this comment.
Suggested change
| source_uri = if %r{://}.match?(data['source']) | |
| source_uri = data['source']&.include?('://') |
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
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.
Summary
Provide a detailed description of all the changes present in this pull request.
Additional Context
Add any additional context about the problem here.
Related Issues (if any)
Mention any related issues or pull requests.