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?\?/