Skip to content

Commit

Permalink
Only add a comma before a newline
Browse files Browse the repository at this point in the history
  • Loading branch information
raphink committed Feb 10, 2015
1 parent 0bc6a3e commit c49e00c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/puppet-lint/plugins/check_trailing_comma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ def check
lbo_token = resource[:tokens][-1].prev_code_token
if lbo_token && lbo_token.type != :COLON && \
resource[:tokens][-1].type != :SEMIC && \
lbo_token.type != :COMMA
lbo_token.type != :COMMA && \
lbo_token.next_token.type == :NEWLINE
notify :warning, {
:message => 'missing trailing comma after last parameter',
:line => lbo_token.next_token.line,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class { '::apache':
file { '/tmp/bar':
ensure => file;
}
resources { 'sshkey': purge => true }
EOS
}

Expand Down Expand Up @@ -52,6 +54,8 @@ class { '::apache':
file { '/tmp/bar':
ensure => file;
}
resources { 'sshkey': purge => true }
EOS
}

Expand Down Expand Up @@ -95,6 +99,8 @@ class { '::apache':
file { '/tmp/bar':
ensure => file;
}
resources { 'sshkey': purge => true }
EOS
}

Expand Down Expand Up @@ -127,6 +133,8 @@ class { '::apache':
file { '/tmp/bar':
ensure => file;
}
resources { 'sshkey': purge => true }
EOS
}

Expand Down Expand Up @@ -159,6 +167,8 @@ class { '::apache':
file { '/tmp/bar':
ensure => file;
}
resources { 'sshkey': purge => true }
EOS
)
end
Expand Down

0 comments on commit c49e00c

Please sign in to comment.