Skip to content
Snippets Groups Projects
Commit 23575f3c authored by Tobias Lidskog's avatar Tobias Lidskog Committed by Jack Nagel
Browse files

audit: correct inverted has_trailing_newline condition


has_trailing_newline? checked if formula did not have a trailing
newline. Invert regex and invert audit check.

Closes Homebrew/homebrew#18359.

Signed-off-by: default avatarJack Nagel <jacknagel@gmail.com>
parent 04dfdd97
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,7 @@ class FormulaText
end
def has_trailing_newline?
/.+\z/ =~ @text
/\Z\n/ =~ @text
end
end
......@@ -112,7 +112,7 @@ class FormulaAuditor
problem "'__END__' was found, but 'DATA' is not used"
end
if f.text.has_trailing_newline?
unless f.text.has_trailing_newline?
problem "File should end with a newline"
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment