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: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
04dfdd972c
commit
23575f3c7f
@ -68,7 +68,7 @@ class FormulaText
|
|||||||
end
|
end
|
||||||
|
|
||||||
def has_trailing_newline?
|
def has_trailing_newline?
|
||||||
/.+\z/ =~ @text
|
/\Z\n/ =~ @text
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ class FormulaAuditor
|
|||||||
problem "'__END__' was found, but 'DATA' is not used"
|
problem "'__END__' was found, but 'DATA' is not used"
|
||||||
end
|
end
|
||||||
|
|
||||||
if f.text.has_trailing_newline?
|
unless f.text.has_trailing_newline?
|
||||||
problem "File should end with a newline"
|
problem "File should end with a newline"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user