Skip to content

Commit fded4a5

Browse files
authored
Merge pull request #9179 from joshcooper/rubocop_7x_11931
(PUP-11931) Backport some Lint rubocops to 7.x
2 parents 7e0a01a + f116917 commit fded4a5

File tree

4 files changed

+4
-15
lines changed

4 files changed

+4
-15
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -652,17 +652,6 @@ Lint/InheritException:
652652
- 'lib/puppet/util/logging.rb'
653653
- 'lib/puppet/util/retry_action.rb'
654654

655-
# This cop supports unsafe auto-correction (--auto-correct-all).
656-
Lint/InterpolationCheck:
657-
Exclude:
658-
- 'lib/puppet/util/package/version/pip.rb'
659-
660-
# This cop supports safe auto-correction (--auto-correct).
661-
Lint/LiteralInInterpolation:
662-
Exclude:
663-
- 'lib/puppet/provider/package/yum.rb'
664-
- 'lib/puppet/type/component.rb'
665-
666655
Lint/MissingSuper:
667656
Enabled: false
668657

lib/puppet/provider/package/yum.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def install
255255
operation = update_command
256256
self.debug "Ensuring latest, so using #{operation}"
257257
else
258-
self.debug "Ensuring latest, but package is absent, so using #{:install}"
258+
self.debug "Ensuring latest, but package is absent, so using install"
259259
operation = :install
260260
end
261261
should = nil

lib/puppet/type/component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def refresh
6363
catalog.adjacent(self).each do |child|
6464
if child.respond_to?(:refresh)
6565
child.refresh
66-
child.log "triggering #{:refresh}"
66+
child.log "triggering refresh"
6767
end
6868
end
6969
end

lib/puppet/util/package/version/pip.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ def compare(this, other)
149149
return compare(element, other.at(index)) if element != other.at(index)
150150
end
151151
elsif (this.is_a? Array) && !(other.is_a? Array)
152-
raise Puppet::Error, 'Cannot compare #{this} (Array) with #{other} (#{other.class}). Only ±Float::INFINITY accepted.' unless other.abs == Float::INFINITY
152+
raise Puppet::Error, "Cannot compare #{this} (Array) with #{other} (#{other.class}). Only ±Float::INFINITY accepted." unless other.abs == Float::INFINITY
153153
return other == -Float::INFINITY ? 1 : -1
154154
elsif !(this.is_a? Array) && (other.is_a? Array)
155-
raise Puppet::Error, 'Cannot compare #{this} (#{this.class}) with #{other} (Array). Only ±Float::INFINITY accepted.' unless this.abs == Float::INFINITY
155+
raise Puppet::Error, "Cannot compare #{this} (#{this.class}) with #{other} (Array). Only ±Float::INFINITY accepted." unless this.abs == Float::INFINITY
156156
return this == -Float::INFINITY ? -1 : 1
157157
end
158158
this <=> other

0 commit comments

Comments
 (0)