Skip to content

Commit 96e4122

Browse files
committed
(CONT-811) Correct Style/TrailingCommaInHashLiteral
1 parent 3c74505 commit 96e4122

File tree

10 files changed

+21
-21
lines changed

10 files changed

+21
-21
lines changed

lib/puppet-lint/bin.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def report_sarif(problems, base_path, base_path_uri)
144144
'ruleIndex' => rule_index,
145145
'message' => { 'text' => message[:message] },
146146
'locations' => [{ 'physicalLocation' => { 'artifactLocation' => { 'uri' => relative_path, 'uriBaseId' => 'ROOTPATH' },
147-
'region' => { 'startLine' => message[:line], 'startColumn' => message[:column] } } }],
147+
'region' => { 'startLine' => message[:line], 'startColumn' => message[:column] } } }]
148148
}
149149
results << result
150150
end

lib/puppet-lint/checkplugin.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def default_info
182182
check: self.class.const_get(:NAME),
183183
fullpath: fullpath,
184184
path: path,
185-
filename: filename,
185+
filename: filename
186186
}
187187
end
188188

lib/puppet-lint/checks.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def load_data(path, content)
3939
column: e.column,
4040
fullpath: PuppetLint::Data.fullpath,
4141
path: PuppetLint::Data.path,
42-
filename: PuppetLint::Data.filename,
42+
filename: PuppetLint::Data.filename
4343
}
4444
PuppetLint::Data.tokens = []
4545
end
@@ -80,7 +80,7 @@ def run(fileinfo, data)
8080
filename: File.basename(fileinfo),
8181
path: fileinfo,
8282
line: e.token.line,
83-
column: e.token.column,
83+
column: e.token.column
8484
}
8585

8686
@problems

lib/puppet-lint/data.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def resource_indexes
197197
end: marker,
198198
tokens: tokens[start_idx..marker],
199199
type: find_resource_type_token(start_idx),
200-
param_tokens: find_resource_param_tokens(tokens[start_idx..marker]),
200+
param_tokens: find_resource_param_tokens(tokens[start_idx..marker])
201201
}
202202
end
203203
result
@@ -326,7 +326,7 @@ def definition_indexes(type)
326326
param_tokens: param_tokens(tokens[i..(i + j + 1)]),
327327
type: type,
328328
name_token: token.next_code_token,
329-
inherited_token: inherited_class,
329+
inherited_token: inherited_class
330330
}
331331
break
332332
end
@@ -378,7 +378,7 @@ def function_indexes
378378
functions << {
379379
start: token_idx,
380380
end: real_idx,
381-
tokens: tokens[token_idx..real_idx],
381+
tokens: tokens[token_idx..real_idx]
382382
}
383383
end
384384
functions
@@ -414,7 +414,7 @@ def array_indexes
414414
arrays << {
415415
start: token_idx,
416416
end: real_idx,
417-
tokens: tokens[token_idx..real_idx],
417+
tokens: tokens[token_idx..real_idx]
418418
}
419419
end
420420
arrays
@@ -452,7 +452,7 @@ def hash_indexes
452452
hashes << {
453453
start: token_idx,
454454
end: real_idx,
455-
tokens: tokens[token_idx..real_idx],
455+
tokens: tokens[token_idx..real_idx]
456456
}
457457
end
458458
hashes
@@ -486,7 +486,7 @@ def defaults_indexes
486486
defaults << {
487487
start: token_idx,
488488
end: real_idx,
489-
tokens: tokens[token_idx..real_idx],
489+
tokens: tokens[token_idx..real_idx]
490490
}
491491
end
492492
defaults

lib/puppet-lint/lexer.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def heredoc_queue
7373
'function' => true,
7474
'type' => true,
7575
'attr' => true,
76-
'private' => true,
76+
'private' => true
7777
}.freeze
7878

7979
# Internal: A Hash whose keys are Strings representing reserved keywords in
@@ -85,7 +85,7 @@ def heredoc_queue
8585
'application' => true,
8686
'consumes' => true,
8787
'produces' => true,
88-
'site' => true,
88+
'site' => true
8989
}.freeze
9090

9191
# Internal: A Hash whose keys are Symbols representing token types which
@@ -101,7 +101,7 @@ def heredoc_queue
101101
IF: true,
102102
ELSIF: true,
103103
LPAREN: true,
104-
EQUALS: true,
104+
EQUALS: true
105105
}.freeze
106106

107107
# Internal: some commonly used regular expressions
@@ -179,7 +179,7 @@ def heredoc_queue
179179
COMMENT: true,
180180
MLCOMMENT: true,
181181
SLASH_COMMENT: true,
182-
INDENT: true,
182+
INDENT: true
183183
}.freeze
184184

185185
# Internal: Access the internal token storage.

lib/puppet-lint/plugins/legacy_facts/legacy_facts.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
'uptime_seconds' => "facts['system_uptime']['seconds']",
101101
'uuid' => "facts['dmi']['product']['uuid']",
102102
'xendomains' => "facts['xen']['domains']",
103-
'zonename' => "facts['solaris_zones']['current']",
103+
'zonename' => "facts['solaris_zones']['current']"
104104
}.freeze
105105

106106
# A list of valid hash key token types
@@ -143,7 +143,7 @@ def check
143143
line: token.line,
144144
column: token.column,
145145
token: token,
146-
fact_name: fact_name,
146+
fact_name: fact_name
147147
}
148148
end
149149
end

lib/puppet-lint/plugins/top_scope_facts/top_scope_facts.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def check
2828
message: 'top scope fact instead of facts hash',
2929
line: token.line,
3030
column: token.column,
31-
token: token,
31+
token: token
3232
}
3333
end
3434
end

lib/puppet-lint/report/codeclimate.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ def self.write_report_file(problems, report_file)
3030
path: message[:path],
3131
lines: {
3232
begin: message[:line],
33-
end: message[:line],
33+
end: message[:line]
3434
}
35-
},
35+
}
3636
}
3737

3838
issue[:fingerprint] = Digest::MD5.hexdigest(Marshal.dump(issue))

spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class HaveProblem
2424
def initialize(method, message)
2525
@expected_problem = {
2626
kind: method.to_s.delete_prefix('contain_').to_sym,
27-
message: message,
27+
message: message
2828
}
2929
@description = ["contain a #{@expected_problem[:kind]}"]
3030
end

spec/spec_helper_acceptance_local.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def puppet_lint(args = [])
1717
{
1818
stdout: stdout.chomp,
1919
stderr: stderr.chomp,
20-
exit_code: status.exitstatus,
20+
exit_code: status.exitstatus
2121
}
2222
end
2323

0 commit comments

Comments
 (0)