diff options
| author | Ian Lancaster | 2014-03-21 06:08:18 -0400 |
|---|---|---|
| committer | Mike McQuaid | 2014-03-21 17:07:27 +0000 |
| commit | 0d8b7deb45eab0e3f15eb6543f3c5f687f1f60da (patch) | |
| tree | 5ee6ee4e5e0056b47f74742d3f6e04520a7bffc8 /Library/Homebrew | |
| parent | 8495494db43969a1da2bc05fb68361d5ddacb1f6 (diff) | |
| download | homebrew-0d8b7deb45eab0e3f15eb6543f3c5f687f1f60da.tar.bz2 | |
audit: suggest proper `if build.with(out)` usage
Closes #27759.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew')
| -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?\?/ |
