Skip to content

Commit

Permalink
Add check for HEREDOC_OPEN with COMMA
Browse files Browse the repository at this point in the history
In some cases, the HEREDOC_OPEN is not followed directly by the content of the HEREDOC, but first by a COMMA

voxpupuli#20 (comment)
  • Loading branch information
gerlingsm authored May 13, 2024
1 parent a18d41b commit 08e90b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/puppet-lint/plugins/check_strict_indent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ def check
token.prev_token.value.split("\n").last.length
elsif !token.prev_token.nil? and token.prev_token.type == :HEREDOC_OPEN
next_token.prev_token.value.split("\n").last.length
elsif !token.prev_token.nil? and !token.prev_token.prev_token.nil? and token.prev_token.type == :COMMA and token.prev_token.prev_token.type == :HEREDOC_OPEN
next_token.prev_token.prev_token.value.split("\n").last.length
else
0
end
Expand Down

0 comments on commit 08e90b1

Please sign in to comment.