Skip to content

Commit 5d126ea

Browse files
committed
Layout/MultilineMethodCallIndentation
This commit enables the Rubocop Layout/MultilineMethodCallIndentation cop and addresses all offenses.
1 parent 111ba38 commit 5d126ea

27 files changed

+135
-141
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, indented_relative_to_receiver
28-
Layout/MultilineMethodCallIndentation:
29-
Enabled: false
30-
3125
# This cop supports safe auto-correction (--auto-correct).
3226
# Configuration parameters: EnforcedStyle.
3327
# SupportedStyles: symmetrical, new_line, same_line

lib/puppet.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ def self.vendored_modules
151151
dir = Puppet[:vendormoduledir]
152152
if dir && File.directory?(dir)
153153
Dir.entries(dir)
154-
.reject { |f| f =~ /^\./ }
155-
.map { |f| File.join(dir, f, "lib") }
156-
.select { |d| FileTest.directory?(d) }
154+
.reject { |f| f =~ /^\./ }
155+
.map { |f| File.join(dir, f, "lib") }
156+
.select { |d| FileTest.directory?(d) }
157157
else
158158
[]
159159
end

lib/puppet/file_serving/fileset.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ def children
139139
return [] unless directory?
140140

141141
Dir.entries(path, encoding: Encoding::UTF_8)
142-
.reject { |child| ignore?(child) }
143-
.collect { |child| down_level(child) }
142+
.reject { |child| ignore?(child) }
143+
.collect { |child| down_level(child) }
144144
end
145145

146146
def ignore?(child)

lib/puppet/interface/documentation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def copyright_owner=(value)
292292
def copyright_years=(value)
293293
years = munge_copyright_year value
294294
years = (years.is_a?(Array) ? years : [years])
295-
.sort_by do |x| x.is_a?(Range) ? x.first : x end
295+
.sort_by do |x| x.is_a?(Range) ? x.first : x end
296296

297297
@copyright_years = years.map do |year|
298298
if year.is_a? Range then

lib/puppet/module/plan.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def self.find_files(name, plan_files)
102102
def self.plans_in_module(pup_module)
103103
# Search e.g. 'modules/<pup_module>/plans' for all plans
104104
plan_files = Dir.glob(File.join(pup_module.plans_directory, '*'))
105-
.keep_if { |f| valid, _ = is_plans_filename?(f); valid }
105+
.keep_if { |f| valid, _ = is_plans_filename?(f); valid }
106106

107107
plans = plan_files.group_by { |f| plan_name_from_path(f) }
108108

lib/puppet/module/task.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def self.is_tasks_executable_filename?(name)
211211

212212
def self.tasks_in_module(pup_module)
213213
task_files = Dir.glob(File.join(pup_module.tasks_directory, '*'))
214-
.keep_if { |f| is_tasks_file?(f) }
214+
.keep_if { |f| is_tasks_file?(f) }
215215

216216
module_executables = task_files.reject(&method(:is_tasks_metadata_filename?)).map.to_a
217217

lib/puppet/network/formats.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def render(datum)
163163
datum.sort_by { |k,_v| k.to_s } .each do |key, value|
164164
output << key.to_s.ljust(column_a)
165165
output << json.render(value)
166-
.chomp.gsub(/\n */) { |x| x + (' ' * column_a) }
166+
.chomp.gsub(/\n */) { |x| x + (' ' * column_a) }
167167
output << "\n"
168168
end
169169
return output

lib/puppet/network/http/api.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ def self.not_found_upgrade
3030
def self.server_routes
3131
server_prefix = Regexp.new("^#{Puppet::Network::HTTP::SERVER_URL_PREFIX}/")
3232
Puppet::Network::HTTP::Route.path(server_prefix)
33-
.any
34-
.chain(Puppet::Network::HTTP::API::Server::V3.routes,
35-
Puppet::Network::HTTP::API.not_found)
33+
.any
34+
.chain(Puppet::Network::HTTP::API::Server::V3.routes,
35+
Puppet::Network::HTTP::API.not_found)
3636
end
3737

3838
def self.master_routes

lib/puppet/network/http/api/server/v3.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ def self.wrap(&block)
2020
end
2121

2222
INDIRECTED = Puppet::Network::HTTP::Route
23-
.path(/.*/)
24-
.any(wrap { Puppet::Network::HTTP::API::IndirectedRoutes.new } )
23+
.path(/.*/)
24+
.any(wrap { Puppet::Network::HTTP::API::IndirectedRoutes.new } )
2525

2626
ENVIRONMENTS = Puppet::Network::HTTP::Route
27-
.path(%r{^/environments$})
28-
.get(wrap { Environments.new(Puppet.lookup(:environments)) } )
27+
.path(%r{^/environments$})
28+
.get(wrap { Environments.new(Puppet.lookup(:environments)) } )
2929

3030
def self.routes
3131
Puppet::Network::HTTP::Route.path(%r{v3})
32-
.any
33-
.chain(ENVIRONMENTS, INDIRECTED)
32+
.any
33+
.chain(ENVIRONMENTS, INDIRECTED)
3434
end
3535
end
3636
end

lib/puppet/pops/evaluator/collectors/exported_collector.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def collect
4040
end
4141

4242
found = Puppet::Resource.indirection
43-
.search(@type, :host => @scope.compiler.node.name, :filter => @equery, :scope => @scope)
43+
.search(@type, :host => @scope.compiler.node.name, :filter => @equery, :scope => @scope)
4444

4545
found_resources = found.map {|x| x.is_a?(Puppet::Parser::Resource) ? x : x.to_resource(@scope)}
4646

0 commit comments

Comments
 (0)