puppet-lint-manifest_whitespace-check 0.1.15 → 0.1.16
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af72a48c82a227107871c1e7b83a3bec2a101aab3cef89bbd3d6ce426122334d
|
4
|
+
data.tar.gz: c7bc25b60155836000ec44971dd88832fafd413cac0e89107c49be5e86e804c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24961bb90cab1231db45ad634bf31444a276645d371401168956a436dd977e23166b19d5b1880e96d8ebfc64c3c53da68c4a65e92643a421094fae5a693ec2f0
|
7
|
+
data.tar.gz: c57d69810e67d335b597cb8257d627a07ac6c31fde14e37f64b8c05e4bb83fc750ca9e87699689211f299268ca287e89d76835259667d6b0876c3ed94f40b04e
|
@@ -7,7 +7,9 @@ PuppetLint.new_check(:manifest_whitespace_opening_bracket_before) do
|
|
7
7
|
prev_code_token = prev_non_space_token(bracket_token)
|
8
8
|
|
9
9
|
next unless prev_token && prev_code_token
|
10
|
-
|
10
|
+
if %i[LBRACK LBRACE COMMA SEMIC COMMENT].include?(prev_code_token.type)
|
11
|
+
next
|
12
|
+
end
|
11
13
|
next unless %i[WHITESPACE NEWLINE INDENT].include?(prev_token.type)
|
12
14
|
|
13
15
|
if %i[INDENT NEWLINE].include?(prev_token.type) && %i[RBRACK RBRACE].include?(prev_code_token.type)
|
@@ -5,6 +5,21 @@ require 'spec_helper'
|
|
5
5
|
describe 'manifest_whitespace_opening_bracket_before' do
|
6
6
|
let(:opening_bracket_msg) { 'there should be a single space before an opening bracket' }
|
7
7
|
|
8
|
+
context 'with iterator' do
|
9
|
+
let(:code) do
|
10
|
+
<<~EOF
|
11
|
+
{
|
12
|
+
# some generic comment
|
13
|
+
['some', 'values']
|
14
|
+
}
|
15
|
+
EOF
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'should detect no problems' do
|
19
|
+
expect(problems).to have(0).problem
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
8
23
|
context 'with iterator' do
|
9
24
|
let(:code) do
|
10
25
|
<<~EOF
|