puppet-lint-class_parameter-check 0.1.2 → 0.1.3
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: 40c9f69e6438b1c1454bfb8f826922cfdd0e39d8
|
4
|
+
data.tar.gz: 2e7620b8cdb14bd0e57935b066ed0a5e2968df9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55e32ac4ac2a6e730571f862776c92d41f8a3c1c6b336e40557f9af83e0547349a65b3a19ab5eacc9604620c1183ef41a0f5d942c28d14192279611fd215df15
|
7
|
+
data.tar.gz: 9fc4aa5d2094ae859aa9d811a783862ff7e7938266f9f1e695612da7ab952eaf2e2809e1ff89805897349a64562eeb7dc312f202c0411d568a2d2db2bb0a8367
|
@@ -55,6 +55,10 @@ class ClassParameterList
|
|
55
55
|
end
|
56
56
|
|
57
57
|
if (token.type == :COMMA || token == @tokens.last) && stack.empty? && parameter.tokens.any?
|
58
|
+
unless [:COMMA, :NEWLINE, :WHITESPACE, :INDENT].include?(token.type)
|
59
|
+
parameter.add(token)
|
60
|
+
end
|
61
|
+
|
58
62
|
# always add a comma and a newline token at the end of each parameter
|
59
63
|
parameter.add(PuppetLint::Lexer::Token.new(:COMMA, ",", 0,0))
|
60
64
|
parameter.add(PuppetLint::Lexer::Token.new(:NEWLINE, "\n", 0,0))
|
@@ -27,6 +27,14 @@ describe 'class_parameter' do
|
|
27
27
|
expect(problems).to have(0).problems
|
28
28
|
end
|
29
29
|
|
30
|
+
context 'in one line' do
|
31
|
+
let(:code) { "class puppet_module(String $alphabetical, String $non_alphabetical){ }" }
|
32
|
+
|
33
|
+
it 'has no problems' do
|
34
|
+
expect(problems).to have(0).problems
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
30
38
|
context 'with hash parameters' do
|
31
39
|
let(:code) { <<-EOF
|
32
40
|
class puppet_module(
|