aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorTobias Lidskog2013-02-21 09:56:30 +0100
committerJack Nagel2013-03-09 14:42:51 -0600
commit4a3158610dd3986e5e45b1d404f5dd7c1adc1c2b (patch)
tree49557181a259cb219a9ca5f3addd2f66c78c6254 /Library
parent6a00bc3c7debbc3f6bd6694288937758f28db78c (diff)
downloadhomebrew-4a3158610dd3986e5e45b1d404f5dd7c1adc1c2b.tar.bz2
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 #18359. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/audit.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 3b1733e0b..74f18c367 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -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