Skip to content

Commit

Permalink
Resource references do not accept a trailing comma
Browse files Browse the repository at this point in the history
  • Loading branch information
raphink committed Feb 18, 2015
1 parent e932b66 commit c4deada
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/puppet-lint/plugins/check_trailing_comma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ def check

# Arrays
array_indexes.each do |array|
# Do not check resource references
next if array[:tokens][0].prev_code_token && \
array[:tokens][0].prev_code_token.type == :CLASSREF
check_elem(array, :LBRACK)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ class { '::apache':
},
'qux' => 'ghi',
}
service { 'bar':
subscribe => File[
'/etc/baz.conf', '/etc/baz.conf.d'
],
}
EOS
}

Expand Down Expand Up @@ -102,6 +108,12 @@ class { '::apache':
},
'qux' => 'ghi'
}
service { 'bar':
subscribe => File[
'/etc/baz.conf', '/etc/baz.conf.d'
],
}
EOS
}

Expand Down Expand Up @@ -174,6 +186,12 @@ class { '::apache':
},
'qux' => 'ghi',
}
service { 'bar':
subscribe => File[
'/etc/baz.conf', '/etc/baz.conf.d'
],
}
EOS
}

Expand Down Expand Up @@ -231,6 +249,12 @@ class { '::apache':
},
'qux' => 'ghi'
}
service { 'bar':
subscribe => File[
'/etc/baz.conf', '/etc/baz.conf.d'
],
}
EOS
}

Expand Down Expand Up @@ -292,6 +316,12 @@ class { '::apache':
},
'qux' => 'ghi',
}
service { 'bar':
subscribe => File[
'/etc/baz.conf', '/etc/baz.conf.d'
],
}
EOS
)
end
Expand Down

0 comments on commit c4deada

Please sign in to comment.