Skip to content

Commit 4e59f24

Browse files
committed
Layout/DotPosition
This commit enables the Rubocop Layout/DotPosition cop.
1 parent cca3806 commit 4e59f24

File tree

18 files changed

+74
-80
lines changed

18 files changed

+74
-80
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.
27-
# SupportedStyles: leading, trailing
28-
Layout/DotPosition:
29-
Enabled: false
30-
3125
# This cop supports safe auto-correction (--auto-correct).
3226
Layout/ElseAlignment:
3327
Enabled: false

lib/puppet/file_serving/fileset.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ def basename
135135
def children
136136
return [] unless directory?
137137

138-
Dir.entries(path, encoding: Encoding::UTF_8).
139-
reject { |child| ignore?(child) }.
140-
collect { |child| down_level(child) }
138+
Dir.entries(path, encoding: Encoding::UTF_8)
139+
.reject { |child| ignore?(child) }
140+
.collect { |child| down_level(child) }
141141
end
142142

143143
def ignore?(child)

lib/puppet/interface/documentation.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ def copyright_owner=(value)
285285
attr_reader :copyright_years
286286
def copyright_years=(value)
287287
years = munge_copyright_year value
288-
years = (years.is_a?(Array) ? years : [years]).
289-
sort_by do |x| x.is_a?(Range) ? x.first : x end
288+
years = (years.is_a?(Array) ? years : [years])
289+
.sort_by do |x| x.is_a?(Range) ? x.first : x end
290290

291291
@copyright_years = years.map do |year|
292292
if year.is_a? Range then

lib/puppet/network/formats.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ def render(datum)
160160
column_a = datum.empty? ? 2 : datum.map{ |k,_v| k.to_s.length }.max + 2
161161
datum.sort_by { |k,_v| k.to_s } .each do |key, value|
162162
output << key.to_s.ljust(column_a)
163-
output << json.render(value).
164-
chomp.gsub(/\n */) { |x| x + (' ' * column_a) }
163+
output << json.render(value)
164+
.chomp.gsub(/\n */) { |x| x + (' ' * column_a) }
165165
output << "\n"
166166
end
167167
return output

lib/puppet/network/http/api.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ class Puppet::Network::HTTP::API
33
require_relative '../../../puppet/version'
44

55
def self.not_found
6-
Puppet::Network::HTTP::Route.
7-
path(/.*/).
8-
any(lambda do |req, _res|
6+
Puppet::Network::HTTP::Route
7+
.path(/.*/)
8+
.any(lambda do |req, _res|
99
raise Puppet::Network::HTTP::Error::HTTPNotFoundError.new("No route for #{req.method} #{req.path}", Puppet::Network::HTTP::Issues::HANDLER_NOT_FOUND)
1010
end)
1111
end
1212

1313
def self.not_found_upgrade
14-
Puppet::Network::HTTP::Route.
15-
path(/.*/).
16-
any(lambda do |_req, _res|
14+
Puppet::Network::HTTP::Route
15+
.path(/.*/)
16+
.any(lambda do |_req, _res|
1717
raise Puppet::Network::HTTP::Error::HTTPNotFoundError.new("Error: Invalid URL - Puppet expects requests that conform to the " +
1818
"/puppet and /puppet-ca APIs.\n\n" +
1919
"Note that Puppet 3 agents aren't compatible with this version; if you're " +
@@ -28,10 +28,10 @@ def self.not_found_upgrade
2828

2929
def self.server_routes
3030
server_prefix = Regexp.new("^#{Puppet::Network::HTTP::SERVER_URL_PREFIX}/")
31-
Puppet::Network::HTTP::Route.path(server_prefix).
32-
any.
33-
chain(Puppet::Network::HTTP::API::Server::V3.routes,
34-
Puppet::Network::HTTP::API.not_found)
31+
Puppet::Network::HTTP::Route.path(server_prefix)
32+
.any
33+
.chain(Puppet::Network::HTTP::API::Server::V3.routes,
34+
Puppet::Network::HTTP::API.not_found)
3535
end
3636

3737
def self.master_routes

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@ class V3
1111

1212
def self.wrap(&block)
1313
lambda do |request, response|
14-
Puppet::Network::Authorization.
15-
check_external_authorization(request.method,
16-
request.path)
14+
Puppet::Network::Authorization
15+
.check_external_authorization(request.method,
16+
request.path)
1717

1818
block.call.call(request, response)
1919
end
2020
end
2121

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

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

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def collect
3939
resource.type == t && resource.exported? && (q.nil? || q.call(resource))
4040
end
4141

42-
found = Puppet::Resource.indirection.
43-
search(@type, :host => @scope.compiler.node.name, :filter => @equery, :scope => @scope)
42+
found = Puppet::Resource.indirection
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

lib/puppet/pops/types/class_loader.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ def self.paths_for_name(fq_named_parts)
120120
private_class_method :paths_for_name
121121

122122
def self.de_camel(fq_name)
123-
fq_name.to_s.gsub(/::/, '/').
124-
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
125-
gsub(/([a-z\d])([A-Z])/,'\1_\2').
126-
tr("-", "_").
127-
downcase
123+
fq_name.to_s.gsub(/::/, '/')
124+
.gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
125+
.gsub(/([a-z\d])([A-Z])/,'\1_\2')
126+
.tr("-", "_")
127+
.downcase
128128
end
129129
private_class_method :de_camel
130130

lib/puppet/pops/types/type_mismatch_describer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,8 +581,8 @@ def validate_default_parameter(subject, param_name, param_type, value, tense = :
581581
end
582582

583583
def get_deferred_function_return_type(value)
584-
func = Puppet.lookup(:loaders).private_environment_loader.
585-
load(:function, value.name)
584+
func = Puppet.lookup(:loaders).private_environment_loader
585+
.load(:function, value.name)
586586
dispatcher = func.class.dispatcher.find_matching_dispatcher(value.arguments)
587587
raise ArgumentError, "No matching arity found for #{func.class.name} with arguments #{value.arguments}" unless dispatcher
588588
dispatcher.type.return_type

lib/puppet/provider/package/gem.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ def self.gemlist(options)
118118
end
119119

120120
begin
121-
list = execute_gem_command(options[:command], command_options).lines.
122-
map {|set| gemsplit(set) }.
123-
reject {|x| x.nil? }
121+
list = execute_gem_command(options[:command], command_options).lines
122+
.map {|set| gemsplit(set) }
123+
.reject {|x| x.nil? }
124124
rescue Puppet::ExecutionFailure => detail
125125
raise Puppet::Error, _("Could not list gems: %{detail}") % { detail: detail }, detail.backtrace
126126
end

0 commit comments

Comments
 (0)