Skip to content

Commit

Permalink
Print a warning if we encounter a lint:endignore comment that we can'…
Browse files Browse the repository at this point in the history
…t match to a lint:ignore comment
  • Loading branch information
rodjek committed Dec 3, 2016
1 parent ef1abbe commit 7c250f5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lib/puppet-lint/data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,17 @@ def parse_control_comments
stack_add << [token.line, reason, check]
end
else
stack.pop.each do |start|
unless start.nil?
(start[0]..token.line).each do |i|
(ignore_overrides[start[2]] ||= {})[i] = start[1]
top_override = stack.pop
if top_override.nil?
# TODO: refactor to provide a way to expose problems from
# PuppetLint::Data via the normal problem reporting mechanism.
puts "WARNING: lint:endignore comment with no opening lint:ignore:<check> comment found on line #{token.line}"
else
top_override.each do |start|
unless start.nil?
(start[0]..token.line).each do |i|
(ignore_overrides[start[2]] ||= {})[i] = start[1]
end
end
end
end
Expand Down

0 comments on commit 7c250f5

Please sign in to comment.