puppet-lint-class_parameter-check 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 65efc25251eee8bc2c28d16e5be4435afb9521bc
4
- data.tar.gz: 349993e2be2bd016e7e16ead67aa00923a8dfd81
3
+ metadata.gz: 40c9f69e6438b1c1454bfb8f826922cfdd0e39d8
4
+ data.tar.gz: 2e7620b8cdb14bd0e57935b066ed0a5e2968df9b
5
5
  SHA512:
6
- metadata.gz: 50eb750c17c5fced42427db76308f7e49e1d8bcce528cf4eb2f19172e5a5d6ae4ceb8dc2f5001a97a5bad26ed3a21cdea697690d82107e7876df0bc6580dfadd
7
- data.tar.gz: 5cb5e02c7bce3fe07b0472a89497c58002bfa8bca9a0e3b1fb2e8c608e6f66f3a9c61ed2cdf9e372882573974b05ca820eea9a9cee7e56d76f619969516c174f
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(
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-lint-class_parameter-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roelof Reitsma