Skip to content

Commit 7666228

Browse files
committed
Layout/EndAlignment
This commit enables the Rubocop Layout/EndAlignment cop and addresses all offenses.
1 parent 9ceca21 commit 7666228

File tree

6 files changed

+15
-21
lines changed

6 files changed

+15
-21
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ I18n/GetText/DecorateStringFormattingUsingPercent:
2222
I18n/RailsI18n/DecorateString:
2323
Enabled: false
2424

25-
# This cop supports safe auto-correction (--auto-correct).
26-
# Configuration parameters: EnforcedStyleAlignWith, Severity.
27-
# SupportedStylesAlignWith: keyword, variable, start_of_line
28-
Layout/EndAlignment:
29-
Enabled: false
30-
3125
# This cop supports safe auto-correction (--auto-correct).
3226
# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
3327
Layout/ExtraSpacing:

lib/puppet/module_tool/metadata.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def validate_name(name)
181181
_("the module name must begin with a letter")
182182
else
183183
_("the namespace contains non-alphanumeric characters")
184-
end
184+
end
185185

186186
raise ArgumentError, _("Invalid 'name' field in metadata.json: %{err}") % { err: err }
187187
end

lib/puppet/parser/scope.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def exist?(name)
300300
else # rubocop:disable Layout/ElseAlignment
301301
next_scope = inherited_scope || enclosing_scope
302302
effective_symtable(true).include?(name) || next_scope && next_scope.exist?(name) || BUILT_IN_VARS.include?(name)
303-
end
303+
end # rubocop:disable Layout/EndAlignment
304304
end
305305

306306
# Returns true if the given name is bound in the current (most nested) scope for assignments.

lib/puppet/provider/package/blastwave.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ def self.blastsplit(line)
6565
hash = {}
6666
hash[:name] = $1
6767
hash[:ensure] = if $2 == "[Not installed]"
68-
:absent
69-
else
70-
$2
71-
end
68+
:absent
69+
else
70+
$2
71+
end
7272
hash[:avail] = $5
7373

7474
hash[:avail] = hash[:ensure] if hash[:avail] == "SAME"

lib/puppet/provider/package/pkgutil.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ def self.pkgsplit(line)
129129
hash = {}
130130
hash[:name] = $1
131131
hash[:ensure] = if $2 == "notinst"
132-
:absent
133-
else
134-
$2
135-
end
132+
:absent
133+
else
134+
$2
135+
end
136136
hash[:avail] = $3
137137

138138
if hash[:avail] =~ /^SAME\s*$/

lib/puppet/provider/package/yum.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,12 +378,12 @@ def scan_options(options, key)
378378

379379
values = options.map do | repo |
380380
value = if repo.is_a?(String)
381-
next unless repo.include?('=')
381+
next unless repo.include?('=')
382382

383-
Hash[*repo.strip.split('=')] # make it a hash
384-
else
385-
repo
386-
end
383+
Hash[*repo.strip.split('=')] # make it a hash
384+
else
385+
repo
386+
end
387387
value[key]
388388
end
389389
values.compact.uniq

0 commit comments

Comments
 (0)