From 58456a5469287314ab38de0f652935b57e210107 Mon Sep 17 00:00:00 2001 From: Ian Lancaster Date: Fri, 21 Mar 2014 06:08:18 -0400 Subject: [PATCH] audit: suggest proper `if build.with(out)` usage Closes Homebrew/homebrew#27759. Signed-off-by: Mike McQuaid --- Library/Homebrew/cmd/audit.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 649796311c..9d8286b8b0 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -462,8 +462,12 @@ class FormulaAuditor problem "Don't duplicate 'without': Use `build.without? \"#{$1}\"` to check for \"--without-#{$1}\"" end - if line =~ /unless build\.with(out)?\?/ - problem "Don't use unless with 'build.with#{$1}': use 'if build.with#{$1}?'" + if line =~ /unless build\.with\?(.*)/ + problem "Use if build.without?#{$1} instead of unless build.with?#{$1}" + end + + if line =~ /unless build\.without\?(.*)/ + problem "Use if build.with?#{$1} instead of unless build.without?#{$1}" end if line =~ /(not\s|!)\s*build\.with?\?/