puppet-lint-manifest_whitespace-check 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/puppet-lint/plugins/check_manifest_whitespace_closing_brace.rb +1 -1
- data/lib/puppet-lint/plugins/check_manifest_whitespace_closing_bracket.rb +3 -1
- data/lib/puppet-lint/plugins/tools.rb +1 -1
- data/spec/puppet-lint/plugins/manifest_whitespace_closing_brace_spec.rb +30 -1
- data/spec/puppet-lint/plugins/manifest_whitespace_closing_bracket_spec.rb +17 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 490924a99a241b6362b189a9279316ace251905f99ff547f8c1f3a1801b196c0
|
4
|
+
data.tar.gz: 425fbd3f5b29ea52822bcf76d93c50261b23991e1a37558f3a999f50152feedc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73d1cb558a99dc97ce5e23f7d0ecde9f05016f830832e7ac534675a9a2b0cd0154c552b0df1acd0f77bd143ed90c6e7bbdf3e8ae015e382a4d2de75cf44cd5e0
|
7
|
+
data.tar.gz: 67bf90d141158f7af8ab63f922eff6b98ffdbf36d69d3f489153c6d02c1823843c31e1ee7453a4d488e56c5f624ea766610f27e1760344d135b64970d1933d51
|
@@ -73,7 +73,7 @@ PuppetLint.new_check(:manifest_whitespace_closing_brace_after) do
|
|
73
73
|
|
74
74
|
notify(
|
75
75
|
:error,
|
76
|
-
message: 'there should be either a bracket,
|
76
|
+
message: 'there should be either a bracket, punctuation mark, closing quote or a newline after a closing brace, or whitespace and none of the aforementioned',
|
77
77
|
line: next_token.line,
|
78
78
|
column: next_token.column,
|
79
79
|
token: next_token,
|
@@ -55,6 +55,8 @@ PuppetLint.new_check(:manifest_whitespace_closing_bracket_after) do
|
|
55
55
|
next unless next_token
|
56
56
|
next if after_bracket_tokens.include?(next_token.type)
|
57
57
|
|
58
|
+
warn next_token.inspect
|
59
|
+
|
58
60
|
if next_token.type == :WHITESPACE
|
59
61
|
next_code_token = next_non_space_token(bracket_token)
|
60
62
|
next unless next_code_token
|
@@ -63,7 +65,7 @@ PuppetLint.new_check(:manifest_whitespace_closing_bracket_after) do
|
|
63
65
|
|
64
66
|
notify(
|
65
67
|
:error,
|
66
|
-
message: 'there should be either a bracket,
|
68
|
+
message: 'there should be either a bracket, punctuation mark, closing quote or a newline after a closing bracket, or whitespace and none of the aforementioned',
|
67
69
|
line: next_token.line,
|
68
70
|
column: next_token.column,
|
69
71
|
token: next_token,
|
@@ -17,6 +17,22 @@ describe 'manifest_whitespace_closing_brace_before' do
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
+
context 'with iterator' do
|
21
|
+
let(:code) do
|
22
|
+
<<~EOF
|
23
|
+
['ib0', 'ib1', 'ib2', 'ib3', 'pub', 'oob', '0', '184'].each |String $name| {
|
24
|
+
}
|
25
|
+
|
26
|
+
['ib0', 'ib1', 'ib2', 'ib3', 'pub', 'oob', '0', '184'].each |String $name| {
|
27
|
+
}
|
28
|
+
EOF
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'should detect no problems' do
|
32
|
+
expect(problems).to have(0).problem
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
20
36
|
context 'with comment only' do
|
21
37
|
let(:code) do
|
22
38
|
<<~EOF
|
@@ -356,7 +372,20 @@ describe 'manifest_whitespace_closing_brace_before' do
|
|
356
372
|
end
|
357
373
|
|
358
374
|
describe 'manifest_whitespace_closing_brace_after' do
|
359
|
-
let(:closing_brace_msg) { 'there should be either a bracket,
|
375
|
+
let(:closing_brace_msg) { 'there should be either a bracket, punctuation mark, closing quote or a newline after a closing brace, or whitespace and none of the aforementioned' }
|
376
|
+
|
377
|
+
context 'with iterator' do
|
378
|
+
let(:code) do
|
379
|
+
<<~EOF
|
380
|
+
['ib0', 'ib1', 'ib2', 'ib3', 'pub', 'oob', '0', '184'].each |String $name| {
|
381
|
+
}
|
382
|
+
EOF
|
383
|
+
end
|
384
|
+
|
385
|
+
it 'should detect no problems' do
|
386
|
+
expect(problems).to have(0).problem
|
387
|
+
end
|
388
|
+
end
|
360
389
|
|
361
390
|
context 'with spaces' do
|
362
391
|
let(:code) do
|
@@ -153,7 +153,23 @@ describe 'manifest_whitespace_closing_bracket_before' do
|
|
153
153
|
end
|
154
154
|
|
155
155
|
describe 'manifest_whitespace_closing_bracket_after' do
|
156
|
-
let(:closing_bracket_msg) { 'there should be either a bracket,
|
156
|
+
let(:closing_bracket_msg) { 'there should be either a bracket, punctuation mark, closing quote or a newline after a closing bracket, or whitespace and none of the aforementioned' }
|
157
|
+
|
158
|
+
context 'with iterator' do
|
159
|
+
let(:code) do
|
160
|
+
<<~EOF
|
161
|
+
['ib0', 'ib1', 'ib2', 'ib3', 'pub', 'oob', '0', '184'].each |String $name| {
|
162
|
+
}
|
163
|
+
|
164
|
+
['ib0', 'ib1', 'ib2', 'ib3', 'pub', 'oob', '0', '184'].each |String $name| {
|
165
|
+
}
|
166
|
+
EOF
|
167
|
+
end
|
168
|
+
|
169
|
+
it 'should detect no problems' do
|
170
|
+
expect(problems).to have(0).problem
|
171
|
+
end
|
172
|
+
end
|
157
173
|
|
158
174
|
context 'with spaces' do
|
159
175
|
let(:code) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-lint-manifest_whitespace-check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jo Vandeginste
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: puppet-lint
|