Skip to content
Snippets Groups Projects
Commit 58456a54 authored by Ian Lancaster's avatar Ian Lancaster Committed by Mike McQuaid
Browse files

audit: suggest proper `if build.with(out)` usage


Closes Homebrew/homebrew#27759.

Signed-off-by: default avatarMike McQuaid <mike@mikemcquaid.com>
parent a105c692
No related branches found
No related tags found
No related merge requests found
......@@ -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?\?/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment