puppet-lint-trailing_comma-check 0.1.1 → 0.1.2
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
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0eae387f233069ed79d644b27f18193e9fccf017
|
|
4
|
+
data.tar.gz: a1a89aea3e4c4f3c173c435253926ceabd5a65c1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 72c08cc4f9fba124c0ac3ec234b61cdee93655e1967e3c0bdb838cb927bc58a7ec523eb933c724bd8b60f54bea32d3e912ad4f282d623bf0f52fff0e7a6e513a
|
|
7
|
+
data.tar.gz: 610ed92e723260a385acd5694acb9ff4899fce9e333c704070be099b9f40454e36d24e284949d93b265f036e0f91f52e434d6c44f15d1cc9651112344c0a0f0a
|
|
@@ -3,7 +3,9 @@ PuppetLint.new_check(:trailing_comma) do
|
|
|
3
3
|
# Resource and class declarations
|
|
4
4
|
resource_indexes.each do |resource|
|
|
5
5
|
lbo_token = resource[:tokens][-1].prev_code_token
|
|
6
|
-
if lbo_token && lbo_token.type != :COLON &&
|
|
6
|
+
if lbo_token && lbo_token.type != :COLON && \
|
|
7
|
+
resource[:tokens][-1].type != :SEMIC && \
|
|
8
|
+
lbo_token.type != :COMMA
|
|
7
9
|
notify :warning, {
|
|
8
10
|
:message => 'missing trailing comma after last parameter',
|
|
9
11
|
:line => lbo_token.next_token.line,
|
|
@@ -20,6 +20,10 @@ describe 'trailing_comma' do
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
file { '/tmp/foo': }
|
|
23
|
+
|
|
24
|
+
file { '/tmp/bar':
|
|
25
|
+
ensure => file;
|
|
26
|
+
}
|
|
23
27
|
EOS
|
|
24
28
|
}
|
|
25
29
|
|
|
@@ -44,6 +48,10 @@ describe 'trailing_comma' do
|
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
file { '/tmp/foo': }
|
|
51
|
+
|
|
52
|
+
file { '/tmp/bar':
|
|
53
|
+
ensure => file;
|
|
54
|
+
}
|
|
47
55
|
EOS
|
|
48
56
|
}
|
|
49
57
|
|
|
@@ -83,6 +91,10 @@ describe 'trailing_comma' do
|
|
|
83
91
|
}
|
|
84
92
|
|
|
85
93
|
file { '/tmp/foo': }
|
|
94
|
+
|
|
95
|
+
file { '/tmp/bar':
|
|
96
|
+
ensure => file;
|
|
97
|
+
}
|
|
86
98
|
EOS
|
|
87
99
|
}
|
|
88
100
|
|
|
@@ -111,6 +123,10 @@ describe 'trailing_comma' do
|
|
|
111
123
|
}
|
|
112
124
|
|
|
113
125
|
file { '/tmp/foo': }
|
|
126
|
+
|
|
127
|
+
file { '/tmp/bar':
|
|
128
|
+
ensure => file;
|
|
129
|
+
}
|
|
114
130
|
EOS
|
|
115
131
|
}
|
|
116
132
|
|
|
@@ -139,6 +155,10 @@ describe 'trailing_comma' do
|
|
|
139
155
|
}
|
|
140
156
|
|
|
141
157
|
file { '/tmp/foo': }
|
|
158
|
+
|
|
159
|
+
file { '/tmp/bar':
|
|
160
|
+
ensure => file;
|
|
161
|
+
}
|
|
142
162
|
EOS
|
|
143
163
|
)
|
|
144
164
|
end
|