diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index b97e5610ee..a307a83498 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -391,7 +391,9 @@ class FormulaAuditor end if o.name =~ /^with(out)?-(?:checks?|tests)$/ - problem "Use '--with#{$1}-test' instead of '--#{o.name}'. Migrate '--#{o.name}' with `deprecated_option`." + unless formula.deps.any? { |d| d.name == "check" && (d.optional? || d.recommended?) } + problem "Use '--with#{$1}-test' instead of '--#{o.name}'. Migrate '--#{o.name}' with `deprecated_option`." + end end end end