audit: make has_DATA? ignore commented-out lines

Before this change, audit would detect commented-out lines
containing the string 'DATA' as if there were no commenting.
Then it could complain, e.g., problem "'DATA' was found, but no
'__END__'", which would be a false alarm in that circumstance.

Closes Homebrew/homebrew#32568.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
chdiza 2014-09-23 15:47:34 -04:00 committed by Jack Nagel
parent d7dddc8f08
commit 22d8380b05

View File

@ -57,7 +57,7 @@ class FormulaText
end
def has_DATA?
/\bDATA\b/ =~ @text
/^[^#]*\bDATA\b/ =~ @text
end
def has_END?