Skip to content

Commit 8433171

Browse files
committed
Layout/SpaceAfterComma
This commit enables the Rubocop Layout/SpaceAfterComma cop and addresses all offenses.
1 parent 8c656a9 commit 8433171

File tree

168 files changed

+367
-371
lines changed

Some content is hidden

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

168 files changed

+367
-371
lines changed

.rubocop_todo.yml

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

25-
# This cop supports safe auto-correction (--auto-correct).
26-
Layout/SpaceAfterComma:
27-
Enabled: false
28-
2925
# This cop supports safe auto-correction (--auto-correct).
3026
Layout/SpaceAfterNot:
3127
Enabled: false

ext/windows/service/daemon.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def service_main(*argsv)
3838

3939
if (@LOG_TO_FILE)
4040
FileUtils.mkdir_p(File.dirname(LOG_FILE))
41-
args = args.gsub("--logtofile","")
41+
args = args.gsub("--logtofile", "")
4242
end
4343

4444
base_dir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
@@ -141,7 +141,7 @@ def log(msg, level)
141141
end
142142
end
143143

144-
def report_windows_event(type,id,message)
144+
def report_windows_event(type, id, message)
145145
begin
146146
eventlog = nil
147147
eventlog = Puppet::Util::Windows::EventLog.open("Puppet")
@@ -174,7 +174,7 @@ def parse_runinterval(puppet_path)
174174
runinterval
175175
end
176176

177-
def parse_log_level(puppet_path,cmdline_debug)
177+
def parse_log_level(puppet_path, cmdline_debug)
178178
begin
179179
loglevel = %x{ #{puppet_path} config --section agent --log_level notice print log_level }.chomp
180180
unless loglevel && respond_to?("log_#{loglevel}")
@@ -206,7 +206,7 @@ def load_env(base_dir)
206206
].join(';').tr('/', '\\') + ';' + ENV['Path']
207207

208208
# ENV that uses forward slashes
209-
ENV['RUBYLIB'] = "#{File.join(base_dir, 'puppet','lib')};#{ENV['RUBYLIB']}"
209+
ENV['RUBYLIB'] = "#{File.join(base_dir, 'puppet', 'lib')};#{ENV['RUBYLIB']}"
210210
rescue => e
211211
log_exception(e)
212212
end

lib/hiera/puppet_function.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ def self.init_dispatch
1616

1717
dispatch :hiera_no_default do
1818
scope_param
19-
param 'String',:key
19+
param 'String', :key
2020
end
2121

2222
dispatch :hiera_with_default do
2323
scope_param
24-
param 'String',:key
24+
param 'String', :key
2525
param 'Any', :default
2626
optional_param 'Any', :override
2727
end

lib/puppet.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def self.[](param)
9191
require_relative 'puppet/feature/base'
9292

9393
# setting access and stuff
94-
def self.[]=(param,value)
94+
def self.[]=(param, value)
9595
@@settings[param] = value
9696
end
9797

lib/puppet/application.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def controlled_run(&block)
178178

179179
# used to declare code that handle an option
180180
def option(*options, &block)
181-
long = options.find { |opt| opt =~ /^--/ }.gsub(/^--(?:\[no-\])?([^ =]+).*$/, '\1' ).tr('-','_')
181+
long = options.find { |opt| opt =~ /^--/ }.gsub(/^--(?:\[no-\])?([^ =]+).*$/, '\1' ).tr('-', '_')
182182
fname = "handle_#{long}".intern
183183
if (block_given?)
184184
define_method(fname, &block)
@@ -514,7 +514,7 @@ def log_runtime_environment(extra_info=nil)
514514
runtime_info['default_encoding'] = Encoding.default_external
515515
runtime_info.merge!(extra_info) unless extra_info.nil?
516516

517-
Puppet.debug 'Runtime environment: ' + runtime_info.map{|k,v| k + '=' + v.to_s}.join(', ')
517+
Puppet.debug 'Runtime environment: ' + runtime_info.map{|k, v| k + '=' + v.to_s}.join(', ')
518518
end
519519

520520
# Options defined with the `option` method are parsed from settings and the command line.
@@ -576,7 +576,7 @@ def self.exit(code)
576576
end
577577

578578
def name
579-
self.class.to_s.sub(/.*::/,"").downcase.to_sym
579+
self.class.to_s.sub(/.*::/, "").downcase.to_sym
580580
end
581581

582582
# Return the text to display when running `puppet help`.

lib/puppet/application/agent.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def preinit
4141
:fingerprint => false,
4242
:sourceaddress => nil,
4343
:start_time => Time.now,
44-
}.each do |opt,val|
44+
}.each do |opt, val|
4545
options[opt] = val
4646
end
4747

@@ -54,10 +54,10 @@ def preinit
5454
end
5555

5656
option("--enable")
57-
option("--debug","-d")
58-
option("--fqdn FQDN","-f")
59-
option("--test","-t")
60-
option("--verbose","-v")
57+
option("--debug", "-d")
58+
option("--fqdn FQDN", "-f")
59+
option("--test", "-t")
60+
option("--verbose", "-v")
6161

6262
option("--fingerprint")
6363
option("--digest DIGEST")
@@ -403,7 +403,7 @@ def log_config
403403
# skip also config reading and parsing if debug is not enabled
404404
return unless Puppet::Util::Log.sendlevel?(:debug)
405405

406-
Puppet.settings.stringify_settings(:agent, :all).each_pair do |k,v|
406+
Puppet.settings.stringify_settings(:agent, :all).each_pair do |k, v|
407407
next if k.include?("password") || v.to_s.empty?
408408

409409
Puppet.debug("Using setting: #{k}=#{v}")

lib/puppet/application/apply.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ class Puppet::Application::Apply < Puppet::Application
88
require_relative '../../puppet/util/splayer'
99
include Puppet::Util::Splayer
1010

11-
option("--debug","-d")
12-
option("--execute EXECUTE","-e") do |arg|
11+
option("--debug", "-d")
12+
option("--execute EXECUTE", "-e") do |arg|
1313
options[:code] = arg
1414
end
15-
option("--loadclasses","-L")
16-
option("--test","-t")
17-
option("--verbose","-v")
15+
option("--loadclasses", "-L")
16+
option("--test", "-t")
17+
option("--verbose", "-v")
1818
option("--use-nodes")
1919
option("--detailed-exitcodes")
2020

lib/puppet/application/describe.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def scrub(text)
4444
# indent from every line.
4545
if text =~ /^(\s+)/
4646
indent = $1
47-
return text.gsub(/^#{indent}/,'')
47+
return text.gsub(/^#{indent}/, '')
4848
else
4949
return text
5050
end
@@ -126,7 +126,7 @@ def format_attrs(type, attrs)
126126
docs[name] = type.attrclass(name).doc if attrs.include?(kind) && name != :provider
127127
end
128128

129-
docs.sort { |a,b|
129+
docs.sort { |a, b|
130130
a[0].to_s <=> b[0].to_s
131131
}.each { |name, doc|
132132
print "\n- **#{name}**"
@@ -169,9 +169,9 @@ class Puppet::Application::Describe < Puppet::Application
169169
options[:parameters] = false
170170
end
171171

172-
option("--providers","-p")
172+
option("--providers", "-p")
173173
option("--list", "-l")
174-
option("--meta","-m")
174+
option("--meta", "-m")
175175

176176
def summary
177177
_("Display help about resource types")

lib/puppet/application/device.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ def preinit
3838
:facts => false,
3939
:target => nil,
4040
:to_yaml => false,
41-
}.each do |opt,val|
41+
}.each do |opt, val|
4242
options[opt] = val
4343
end
4444

4545
@args = {}
4646
end
4747

4848
option("--centrallogging")
49-
option("--debug","-d")
50-
option("--resource","-r")
51-
option("--facts","-f")
52-
option("--to_yaml","-y")
53-
option("--verbose","-v")
49+
option("--debug", "-d")
50+
option("--resource", "-r")
51+
option("--facts", "-f")
52+
option("--to_yaml", "-y")
53+
option("--verbose", "-v")
5454

5555
option("--detailed-exitcodes") do |_arg|
5656
options[:detailed_exitcodes] = true
@@ -72,7 +72,7 @@ def preinit
7272
options[:waitforcert] = arg.to_i
7373
end
7474

75-
option("--port PORT","-p") do |arg|
75+
option("--port PORT", "-p") do |arg|
7676
@args[:Port] = arg
7777
end
7878

@@ -261,7 +261,7 @@ def main
261261
exit(1)
262262
end
263263
end
264-
devices.collect do |_devicename,device|
264+
devices.collect do |_devicename, device|
265265
# TODO when we drop support for ruby < 2.5 we can remove the extra block here
266266
begin
267267
device_url = URI.parse(device.url)

lib/puppet/application/doc.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ class Puppet::Application::Doc < Puppet::Application
88
attr_accessor :unknown_args, :manifest
99

1010
def preinit
11-
{:references => [], :mode => :text, :format => :to_markdown }.each do |name,value|
11+
{:references => [], :mode => :text, :format => :to_markdown }.each do |name, value|
1212
options[name] = value
1313
end
1414
@unknown_args = []
1515
@manifest = false
1616
end
1717

18-
option("--all","-a")
19-
option("--outputdir OUTPUTDIR","-o")
20-
option("--verbose","-v")
21-
option("--debug","-d")
18+
option("--all", "-a")
19+
option("--outputdir OUTPUTDIR", "-o")
20+
option("--verbose", "-v")
21+
option("--debug", "-d")
2222
option("--charset CHARSET")
2323

2424
option("--format FORMAT", "-f") do |arg|

0 commit comments

Comments
 (0)