diff options
| author | Ian Lancaster | 2014-03-21 06:08:18 -0400 |
|---|---|---|
| committer | Mike McQuaid | 2014-03-21 17:07:27 +0000 |
| commit | 58456a5469287314ab38de0f652935b57e210107 (patch) | |
| tree | 7bac06ba44ea11e0808f1cec2040a371417f25e4 /Library/Homebrew/cmd | |
| parent | a105c6921411a944d961bff6543980496dcc5f17 (diff) | |
| download | brew-58456a5469287314ab38de0f652935b57e210107.tar.bz2 | |
audit: suggest proper `if build.with(out)` usage
Closes Homebrew/homebrew#27759.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/audit.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 649796311..9d8286b8b 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?\?/ |
