Skip to content

Commit

Permalink
Merge pull request #9179 from joshcooper/rubocop_7x_11931
Browse files Browse the repository at this point in the history
(PUP-11931) Backport some Lint rubocops to 7.x
  • Loading branch information
AriaXLi committed Dec 5, 2023
2 parents 7e0a01a + f116917 commit fded4a5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
11 changes: 0 additions & 11 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -652,17 +652,6 @@ Lint/InheritException:
- 'lib/puppet/util/logging.rb'
- 'lib/puppet/util/retry_action.rb'

# This cop supports unsafe auto-correction (--auto-correct-all).
Lint/InterpolationCheck:
Exclude:
- 'lib/puppet/util/package/version/pip.rb'

# This cop supports safe auto-correction (--auto-correct).
Lint/LiteralInInterpolation:
Exclude:
- 'lib/puppet/provider/package/yum.rb'
- 'lib/puppet/type/component.rb'

Lint/MissingSuper:
Enabled: false

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/package/yum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def install
operation = update_command
self.debug "Ensuring latest, so using #{operation}"
else
self.debug "Ensuring latest, but package is absent, so using #{:install}"
self.debug "Ensuring latest, but package is absent, so using install"
operation = :install
end
should = nil
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def refresh
catalog.adjacent(self).each do |child|
if child.respond_to?(:refresh)
child.refresh
child.log "triggering #{:refresh}"
child.log "triggering refresh"
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/puppet/util/package/version/pip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ def compare(this, other)
return compare(element, other.at(index)) if element != other.at(index)
end
elsif (this.is_a? Array) && !(other.is_a? Array)
raise Puppet::Error, 'Cannot compare #{this} (Array) with #{other} (#{other.class}). Only ±Float::INFINITY accepted.' unless other.abs == Float::INFINITY
raise Puppet::Error, "Cannot compare #{this} (Array) with #{other} (#{other.class}). Only ±Float::INFINITY accepted." unless other.abs == Float::INFINITY
return other == -Float::INFINITY ? 1 : -1
elsif !(this.is_a? Array) && (other.is_a? Array)
raise Puppet::Error, 'Cannot compare #{this} (#{this.class}) with #{other} (Array). Only ±Float::INFINITY accepted.' unless this.abs == Float::INFINITY
raise Puppet::Error, "Cannot compare #{this} (#{this.class}) with #{other} (Array). Only ±Float::INFINITY accepted." unless this.abs == Float::INFINITY
return this == -Float::INFINITY ? -1 : 1
end
this <=> other
Expand Down

0 comments on commit fded4a5

Please sign in to comment.