Skip to content

Commit aa71d29

Browse files
Merge pull request #9229 from mhashizume/maint/main/new-layout-cops
Fix layout cops
2 parents 068871f + ad31586 commit aa71d29

File tree

13 files changed

+37
-36
lines changed

13 files changed

+37
-36
lines changed

lib/puppet/parameter/value.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def regex?
7878
#
7979
def convert(value)
8080
case value
81-
when Symbol, '' # can't intern an empty string
81+
when Symbol, '' # can't intern an empty string
8282
value
8383
when String
8484
value.intern

lib/puppet/pops/evaluator/runtime3_support.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def accept(diagnostic)
518518
super
519519
IssueReporter.assert_and_report(self, {
520520
:message => "Evaluation Error:",
521-
:emit_warnings => true, # log warnings
521+
:emit_warnings => true, # log warnings
522522
:exception_class => Puppet::PreformattedError
523523
})
524524
if errors?

lib/puppet/pops/parser/lexer2.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class Lexer2
125125
'default' => [:DEFAULT, 'default', 7],
126126
'define' => [:DEFINE, 'define', 6],
127127
'if' => [:IF, 'if', 2],
128-
'elsif' => [:ELSIF, 'elsif', 5],
128+
'elsif' => [:ELSIF, 'elsif', 5],
129129
'else' => [:ELSE, 'else', 4],
130130
'inherits' => [:INHERITS, 'inherits', 8],
131131
'node' => [:NODE, 'node', 4],

lib/puppet/pops/serialization/abstract_writer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
module Puppet::Pops
66
module Serialization
7-
MAX_INTEGER = 0x7fffffffffffffff
7+
MAX_INTEGER = 0x7fffffffffffffff
88
MIN_INTEGER = -0x8000000000000000
99

1010
# Abstract class for protocol specific writers such as MsgPack or JSON

lib/puppet/pops/validation.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,15 +254,15 @@ def ==(o)
254254
alias eql? ==
255255
# rubocop:enable Layout
256256

257+
def hash
258+
@hash ||= [file, source_pos.offset, issue.issue_code, severity].hash
259+
end
260+
257261
# Position is equal if the diagnostic is not located or if referring to the same offset
258262
def same_position?(o)
259263
source_pos.nil? && o.source_pos.nil? || source_pos.offset == o.source_pos.offset
260264
end
261265
private :same_position?
262-
263-
def hash
264-
@hash ||= [file, source_pos.offset, issue.issue_code, severity].hash
265-
end
266266
end
267267

268268
# Formats a diagnostic for output.

lib/puppet/provider/nameservice/directoryservice.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ def getinfo(refresh = false)
511511
# list, then report on the remaining list. Pretty whacky, ehh?
512512
type_properties = [:name] + self.class.resource_type.validproperties
513513
type_properties.delete(:ensure) if type_properties.include? :ensure
514-
type_properties << :guid # append GeneratedUID so we just get the report here
514+
type_properties << :guid # append GeneratedUID so we just get the report here
515515
@property_value_cache_hash = self.class.single_report(@resource[:name], *type_properties)
516516
[:uid, :gid].each do |param|
517517
@property_value_cache_hash[param] = @property_value_cache_hash[param].to_i if @property_value_cache_hash and @property_value_cache_hash.include?(param)

lib/puppet/provider/package/apt.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ def checkforcdrom
9090
# rubocop:enable Layout
9191

9292
if have_cdrom and @resource[:allowcdrom] != :true
93-
raise Puppet::Error,
94-
_("/etc/apt/sources.list contains a cdrom source; not installing. Use 'allowcdrom' to override this failure.")
93+
raise Puppet::Error, _("/etc/apt/sources.list contains a cdrom source; not installing. Use 'allowcdrom' to override this failure.")
9594
end
9695
end
9796

lib/puppet/provider/package/dnfmodule.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def enable(args = @resource[:name])
122122

123123
def uninstall
124124
execute([command(:dnf), 'module', 'remove', '-d', '0', '-e', self.class.error_level, '-y', @resource[:name]])
125-
reset # reset module to the default stream
125+
reset # reset module to the default stream
126126
end
127127

128128
def disable(args = @resource[:name])

lib/puppet/provider/package/yum.rb

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -381,16 +381,18 @@ def disableexcludes
381381
def scan_options(options, key)
382382
return [] unless options.is_a?(Enumerable)
383383

384-
values = options.map do |repo|
385-
value = if repo.is_a?(String)
386-
next unless repo.include?('=')
387-
388-
Hash[*repo.strip.split('=')] # make it a hash
389-
else
390-
repo
391-
end
392-
value[key]
393-
end
384+
values =
385+
options.map do |repo|
386+
value =
387+
if repo.is_a?(String)
388+
next unless repo.include?('=')
389+
390+
Hash[*repo.strip.split('=')] # make it a hash
391+
else
392+
repo
393+
end
394+
value[key]
395+
end
394396
values.compact.uniq
395397
end
396398
end

lib/puppet/provider/user/aix.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def parse_password(f)
187187
match_obj[1]
188188
end
189189

190-
#- **password**
190+
# - **password**
191191
# The user's password, in whatever encrypted format the local machine
192192
# requires. Be sure to enclose any value that includes a dollar sign ($)
193193
# in single quotes ('). Requires features manages_passwords.
@@ -312,49 +312,49 @@ def deletecmd
312312
end
313313

314314
# UNSUPPORTED
315-
#- **profile_membership**
315+
# - **profile_membership**
316316
# Whether specified roles should be treated as the only roles
317317
# of which the user is a member or whether they should merely
318318
# be treated as the minimum membership list. Valid values are
319319
# `inclusive`, `minimum`.
320320
# UNSUPPORTED
321-
#- **profiles**
321+
# - **profiles**
322322
# The profiles the user has. Multiple profiles should be
323323
# specified as an array. Requires features manages_solaris_rbac.
324324
# UNSUPPORTED
325-
#- **project**
325+
# - **project**
326326
# The name of the project associated with a user Requires features
327327
# manages_solaris_rbac.
328328
# UNSUPPORTED
329-
#- **role_membership**
329+
# - **role_membership**
330330
# Whether specified roles should be treated as the only roles
331331
# of which the user is a member or whether they should merely
332332
# be treated as the minimum membership list. Valid values are
333333
# `inclusive`, `minimum`.
334334
# UNSUPPORTED
335-
#- **roles**
335+
# - **roles**
336336
# The roles the user has. Multiple roles should be
337337
# specified as an array. Requires features manages_roles.
338338
# UNSUPPORTED
339-
#- **key_membership**
339+
# - **key_membership**
340340
# Whether specified key value pairs should be treated as the only
341341
# attributes
342342
# of the user or whether they should merely
343343
# be treated as the minimum list. Valid values are `inclusive`,
344344
# `minimum`.
345345
# UNSUPPORTED
346-
#- **keys**
346+
# - **keys**
347347
# Specify user attributes in an array of keyvalue pairs Requires features
348348
# manages_solaris_rbac.
349349
# UNSUPPORTED
350-
#- **allowdupe**
350+
# - **allowdupe**
351351
# Whether to allow duplicate UIDs. Valid values are `true`, `false`.
352352
# UNSUPPORTED
353-
#- **auths**
353+
# - **auths**
354354
# The auths the user has. Multiple auths should be
355355
# specified as an array. Requires features manages_solaris_rbac.
356356
# UNSUPPORTED
357-
#- **auth_membership**
357+
# - **auth_membership**
358358
# Whether specified auths should be treated as the only auths
359359
# of which the user is a member or whether they should merely
360360
# be treated as the minimum membership list. Valid values are

0 commit comments

Comments
 (0)