Skip to content

Commit 39ed80f

Browse files
committed
Layout/MultilineOperationIndentation
This commit enables the Rubocop Layout/MultilineOperationIndentation cop and addresses all offenses.
1 parent 3e996e7 commit 39ed80f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+180
-186
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: EnforcedStyle, IndentationWidth.
27-
# SupportedStyles: aligned, indented
28-
Layout/MultilineOperationIndentation:
29-
Enabled: false
30-
3125
# This cop supports safe auto-correction (--auto-correct).
3226
# Configuration parameters: EnforcedStyle, IndentationWidth.
3327
# SupportedStyles: with_first_parameter, with_fixed_indentation

lib/hiera/puppet_function.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def lookup(scope, key, default, has_default, override, &default_block)
6565
# TRANSLATORS 'lookup' is a puppet function and should not be translated
6666
message = _("The function '%{class_name}' is deprecated in favor of using 'lookup'.") % { class_name: self.class.name }
6767
message += ' '+ _("See https://puppet.com/docs/puppet/%{minor_version}/deprecated_language.html") %
68-
{ minor_version: Puppet.minor_version }
68+
{ minor_version: Puppet.minor_version }
6969
Puppet.warn_once('deprecations', self.class.name, message)
7070
end
7171
lookup_invocation = Puppet::Pops::Lookup::Invocation.new(scope, {}, {})

lib/puppet/external/dot.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -201,19 +201,19 @@ def to_s(t = '')
201201
t + $tab + "label = #{stringify(@options['label'])}\n" :
202202
'' :
203203
t + $tab + 'label = "' + " \\\n" +
204-
t + $tab2 + "#{stringify(@options['label'])}| \\\n" +
205-
@ports.collect{ |i|
206-
t + $tab2 + i.to_s
207-
}.join( "| \\\n" ) + " \\\n" +
208-
t + $tab + '"' + "\n"
204+
t + $tab2 + "#{stringify(@options['label'])}| \\\n" +
205+
@ports.collect{ |i|
206+
t + $tab2 + i.to_s
207+
}.join( "| \\\n" ) + " \\\n" +
208+
t + $tab + '"' + "\n"
209209

210210
t + "#{@name} [\n" +
211-
@options.to_a.collect{ |i|
212-
i[1] && i[0] != 'label' ?
213-
t + $tab + "#{i[0]} = #{i[1]}" : nil
214-
}.compact.join( ",\n" ) + ( label != '' ? ",\n" : "\n" ) +
215-
label +
216-
t + "]\n"
211+
@options.to_a.collect{ |i|
212+
i[1] && i[0] != 'label' ?
213+
t + $tab + "#{i[0]} = #{i[1]}" : nil
214+
}.compact.join( ",\n" ) + ( label != '' ? ",\n" : "\n" ) +
215+
label +
216+
t + "]\n"
217217
end
218218

219219
private

lib/puppet/face/config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
def warn_default_section(section_name)
100100
messages = []
101101
messages << _("No section specified; defaulting to '%{section_name}'.") %
102-
{ section_name: section_name }
102+
{ section_name: section_name }
103103
# TRANSLATORS '--section' is a command line option and should not be translated
104104
messages << _("Set the config section by using the `--section` flag.")
105105
# TRANSLATORS `puppet config --section user print foo` is a command line example and should not be translated

lib/puppet/face/epp.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
end
9696
if !missing_files.empty?
9797
raise Puppet::Error, _("One or more file(s) specified did not exist:\n%{missing_files_list}") %
98-
{ missing_files_list: missing_files.map { |f| " #{f}" }.join("\n") }
98+
{ missing_files_list: missing_files.map { |f| " #{f}" }.join("\n") }
9999
else
100100
# Exit with 1 if there were errors
101101
raise Puppet::Error, _("Errors while validating epp") unless status
@@ -197,7 +197,7 @@
197197

198198
if !missing_files.empty?
199199
raise Puppet::Error, _("One or more file(s) specified did not exist:\n%{missing_files_list}") %
200-
{ missing_files_list: missing_files.collect { |f| " #{f}" }.join("\n") }
200+
{ missing_files_list: missing_files.collect { |f| " #{f}" }.join("\n") }
201201
end
202202
end
203203
buffer.string

lib/puppet/face/module/install.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
tree = Puppet::ModuleTool.build_tree(return_value[:graph], return_value[:install_dir])
142142

143143
"#{return_value[:install_dir]}\n" +
144-
Puppet::ModuleTool.format_tree(tree)
144+
Puppet::ModuleTool.format_tree(tree)
145145
end
146146
end
147147
end

lib/puppet/face/module/upgrade.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
tree = Puppet::ModuleTool.build_tree(return_value[:graph], return_value[:base_dir])
8282

8383
"#{return_value[:base_dir]}\n" +
84-
Puppet::ModuleTool.format_tree(tree)
84+
Puppet::ModuleTool.format_tree(tree)
8585
end
8686
end
8787
end

lib/puppet/feature/libuser.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66
Puppet.features.add(:libuser) {
77
File.executable?("/usr/sbin/lgroupadd") and
8-
File.executable?("/usr/sbin/luseradd") and
9-
Puppet::FileSystem.exist?(Puppet::Util::Libuser.getconf)
8+
File.executable?("/usr/sbin/luseradd") and
9+
Puppet::FileSystem.exist?(Puppet::Util::Libuser.getconf)
1010
}

lib/puppet/forge.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def initialize(source, data)
139139
Puppet::ModuleTool.parse_module_dependency(release, dep)[0..1]
140140
rescue ArgumentError => e
141141
raise ArgumentError, _("Malformed dependency: %{name}.") % { name: dep['name'] } +
142-
' ' + _("Exception was: %{detail}") % { detail: e }
142+
' ' + _("Exception was: %{detail}") % { detail: e }
143143
end
144144
end
145145
else

lib/puppet/functions/slice.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def asserted_slice_serving_size(pblock, slice_size)
120120

121121
unless serving_size == 1 || serving_size == slice_size
122122
raise ArgumentError, _("slice(): block must define one parameter, or the same number of parameters as the given size of the slice (%{slice_size}). Block has %{serving_size}; %{parameter_names}") %
123-
{ slice_size: slice_size, serving_size: serving_size, parameter_names: pblock.parameter_names.join(', ') }
123+
{ slice_size: slice_size, serving_size: serving_size, parameter_names: pblock.parameter_names.join(', ') }
124124
end
125125
serving_size
126126
end

0 commit comments

Comments
 (0)