puppet-lint-manifest_whitespace-check 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: deec283a984c69934edd2522701fd6e840fb15e5ebbaf5d836366e59a6f7d894
4
- data.tar.gz: e4b9559d3d6f82ef25f362b1bcbf8d7e8268e2f54089398dfb22519f6529b289
3
+ metadata.gz: 490924a99a241b6362b189a9279316ace251905f99ff547f8c1f3a1801b196c0
4
+ data.tar.gz: 425fbd3f5b29ea52822bcf76d93c50261b23991e1a37558f3a999f50152feedc
5
5
  SHA512:
6
- metadata.gz: 4a49d305962a6ea8168b6deb0f3ec7baf47276d7c6aa56c3869f16f73ed3ade68c3ff63acea7a5ebdef71cab5388b67b5d5cfc898d2f2f2daaa3bb9d7867a4a2
7
- data.tar.gz: 10217466afcdf5fcd832eb08a54d1031c1f88d417783bc77da4a035ee3dfa5cfacc020ee87bac0b030abe59d80f080f596ffa0c803cddaf73aa0f312a3ac7d1d
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, comma, colon, closing quote or a newline after a closing brace, or whitespace and none of the aforementioned',
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, comma, colon, closing quote or a newline after a closing bracket, or whitespace and none of the aforementioned',
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,
@@ -9,7 +9,7 @@ def new_single_space
9
9
  end
10
10
 
11
11
  def after_bracket_tokens
12
- %i[RBRACE RBRACK RPAREN SEMIC COMMA COLON NEWLINE DQMID DQPOST LBRACK]
12
+ %i[RBRACE RBRACK RPAREN SEMIC COMMA COLON DOT NEWLINE DQMID DQPOST LBRACK]
13
13
  end
14
14
 
15
15
  def prev_non_space_token(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, comma, colon, closing quote or a newline after a closing brace, or whitespace and none of the aforementioned' }
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, comma, colon, closing quote or a newline after a closing bracket, or whitespace and none of the aforementioned' }
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.9
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-25 00:00:00.000000000 Z
11
+ date: 2020-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puppet-lint