Skip to content

Commit 4a53dea

Browse files
committed
Layout/SpaceBeforeComma
This commit enables the Rubocop Layout/SpaceBeforeComma cop and addresses all offenses.
1 parent 4be9889 commit 4a53dea

File tree

13 files changed

+17
-29
lines changed

13 files changed

+17
-29
lines changed

.rubocop_todo.yml

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

25-
# This cop supports safe auto-correction (--auto-correct).
26-
Layout/SpaceBeforeComma:
27-
Exclude:
28-
- 'lib/puppet/application/lookup.rb'
29-
- 'lib/puppet/external/dot.rb'
30-
- 'lib/puppet/face/parser.rb'
31-
- 'lib/puppet/indirector/file_bucket_file/file.rb'
32-
- 'lib/puppet/parser/compiler.rb'
33-
- 'lib/puppet/parser/script_compiler.rb'
34-
- 'lib/puppet/pops/lookup/global_data_provider.rb'
35-
- 'lib/puppet/pops/parser/lexer2.rb'
36-
- 'lib/puppet/provider/package/windows.rb'
37-
- 'lib/puppet/provider/package/windows/exe_package.rb'
38-
- 'lib/puppet/util/windows/monkey_patches/process.rb'
39-
- 'lib/puppet/util/windows/user.rb'
40-
4125
# This cop supports safe auto-correction (--auto-correct).
4226
# Configuration parameters: AllowForAlignment.
4327
Layout/SpaceBeforeFirstArg:

lib/puppet/application/lookup.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def generate_scope
364364
if TRUSTED_INFORMATION_FACTS.any? { |key| given_facts.key? key }
365365
unless TRUSTED_INFORMATION_FACTS.all? { |key| given_facts.key? key }
366366
raise _("When overriding any of the %{trusted_facts_list} facts with %{fact_file} "\
367-
"given via the --facts flag, they must all be overridden.") % { fact_file: fact_file , trusted_facts_list: TRUSTED_INFORMATION_FACTS.join(',')}
367+
"given via the --facts flag, they must all be overridden.") % { fact_file: fact_file, trusted_facts_list: TRUSTED_INFORMATION_FACTS.join(',')}
368368
end
369369
end
370370
end

lib/puppet/external/dot.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def change_tab(t)
4646
'shape', # default: ellipse; node shape; see Section 2.1 and Appendix E
4747
'shapefile', # external EPSF or SVG custom shape file
4848
'sides', # default: 4; number of sides for shape=polygon
49-
'skew' , # default: 0.0; skewing of node for shape=polygon
49+
'skew', # default: 0.0; skewing of node for shape=polygon
5050
'style', # graphics options, e.g. bold, dotted, filled; cf. Section 2.3
5151
'toplabel', # auxiliary label for nodes of shape M*
5252
'URL', # URL associated with node (format-dependent)

lib/puppet/face/parser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def validate_manifest(manifest = nil)
213213
env = Puppet.lookup(:current_environment)
214214
loaders = Puppet::Pops::Loaders.new(env)
215215

216-
Puppet.override( {:loaders => loaders } , _('For puppet parser validate')) do
216+
Puppet.override( {:loaders => loaders }, _('For puppet parser validate')) do
217217
begin
218218
validation_environment = manifest ? env.override_with(:manifest => manifest) : env
219219
validation_environment.check_for_reparse

lib/puppet/indirector/file_bucket_file/file.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def list(request)
6969
filestat = Time.parse(item.stat.mtime.to_s)
7070
if from <= filestat and filestat <= to
7171
filenames.each do |filename|
72-
bucket[filename] += [[ item.stat.mtime , item.parent.basename ]]
72+
bucket[filename] += [[ item.stat.mtime, item.parent.basename ]]
7373
end
7474
end
7575
end

lib/puppet/parser/compiler.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ def add_catalog_validators
116116
def_delegator :@catalog, :classes, :classlist
117117

118118
def with_context_overrides(description = '', &block)
119-
Puppet.override( @context_overrides , description, &block)
119+
Puppet.override( @context_overrides, description, &block)
120120
end
121121

122122
# Compiler our catalog. This mostly revolves around finding and evaluating classes.
123123
# This is the main entry into our catalog.
124124
def compile
125-
Puppet.override( @context_overrides , _("For compiling %{node}") % { node: node.name }) do
125+
Puppet.override( @context_overrides, _("For compiling %{node}") % { node: node.name }) do
126126
@catalog.environment_instance = environment
127127

128128
# Set the client's parameters into the top scope.
@@ -531,7 +531,7 @@ def initvars
531531
# It cannot survive the initvars method, and is later reinstated
532532
# as part of compiling...
533533
#
534-
Puppet.override( @context_overrides , _("For initializing compiler")) do
534+
Puppet.override( @context_overrides, _("For initializing compiler")) do
535535
# THE MAGIC STARTS HERE ! This triggers parsing, loading etc.
536536
@catalog.version = environment.known_resource_types.version
537537
@loaders.pre_load

lib/puppet/parser/script_compiler.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Puppet::Parser::ScriptCompiler
3131
attr_reader :node_name
3232

3333
def with_context_overrides(description = '', &block)
34-
Puppet.override( @context_overrides , description, &block)
34+
Puppet.override( @context_overrides, description, &block)
3535
end
3636

3737
# Evaluates the configured setup for a script + code in an environment with modules
@@ -41,7 +41,7 @@ def compile
4141
Puppet[:strict] = :error
4242

4343
# TRANSLATORS, "For running script" is not user facing
44-
Puppet.override( @context_overrides , "For running script") do
44+
Puppet.override( @context_overrides, "For running script") do
4545
# TRANSLATORS "main" is a function name and should not be translated
4646
result = Puppet::Util::Profiler.profile(_("Script: Evaluated main"), [:script, :evaluate_main]) { evaluate_main }
4747
if block_given?

lib/puppet/pops/lookup/global_data_provider.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def unchecked_key_lookup(key, lookup_invocation, merge)
2121
# Confine to global scope unless an environment data provider has been defined (same as for hiera_xxx functions)
2222
adapter = lookup_invocation.lookup_adapter
2323
hiera_invocation.set_global_only unless adapter.global_only? || adapter.has_environment_data_provider?(lookup_invocation)
24-
hiera_invocation.lookup(key, lookup_invocation.module_name) { unchecked_key_lookup(key , hiera_invocation, merge) }
24+
hiera_invocation.lookup(key, lookup_invocation.module_name) { unchecked_key_lookup(key, hiera_invocation, merge) }
2525
end
2626
end
2727

lib/puppet/pops/parser/lexer2.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ class Lexer2
7272
TOKEN_TIMES = [:TIMES, '*', 1].freeze
7373
TOKEN_MODULO = [:MODULO, '%', 1].freeze
7474

75+
# rubocop:disable Layout/SpaceBeforeComma
7576
TOKEN_NOT = [:NOT, '!', 1].freeze
7677
TOKEN_DOT = [:DOT, '.', 1].freeze
7778
TOKEN_PIPE = [:PIPE, '|', 1].freeze
@@ -82,6 +83,7 @@ class Lexer2
8283
TOKEN_SEMIC = [:SEMIC, ';', 1].freeze
8384
TOKEN_QMARK = [:QMARK, '?', 1].freeze
8485
TOKEN_TILDE = [:TILDE, '~', 1].freeze # lexed but not an operator in Puppet
86+
# rubocop:enable Layout/SpaceBeforeComma
8587

8688
TOKEN_REGEXP = [:REGEXP, nil, 0].freeze
8789

lib/puppet/provider/package/windows.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def self.post_resource_eval
4242
begin
4343
Puppet::FileSystem.unlink(path)
4444
rescue => detail
45-
raise Puppet::Error.new(_("Error when unlinking %{path}: %{detail}") % { path: path , detail: detail.message}, detail)
45+
raise Puppet::Error.new(_("Error when unlinking %{path}: %{detail}") % { path: path, detail: detail.message}, detail)
4646
end
4747
end if @paths
4848
end

0 commit comments

Comments
 (0)