audit: suggest proper if build.with(out) usage
Closes Homebrew/homebrew#27759. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
a105c69214
commit
58456a5469
@ -462,8 +462,12 @@ class FormulaAuditor
|
|||||||
problem "Don't duplicate 'without': Use `build.without? \"#{$1}\"` to check for \"--without-#{$1}\""
|
problem "Don't duplicate 'without': Use `build.without? \"#{$1}\"` to check for \"--without-#{$1}\""
|
||||||
end
|
end
|
||||||
|
|
||||||
if line =~ /unless build\.with(out)?\?/
|
if line =~ /unless build\.with\?(.*)/
|
||||||
problem "Don't use unless with 'build.with#{$1}': use 'if build.with#{$1}?'"
|
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
|
end
|
||||||
|
|
||||||
if line =~ /(not\s|!)\s*build\.with?\?/
|
if line =~ /(not\s|!)\s*build\.with?\?/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user