Fix Audit check for env :std

When performing a strict audit of a formula in the core tap, it was
possible that the check for `env :std` would not happen.
This commit is contained in:
George Waters 2019-11-13 15:52:58 -05:00
parent 930bbe0b9c
commit 8221e32ad4

View File

@ -948,15 +948,13 @@ module Homebrew
problem "`Use :optional` or `:recommended` instead of `#{Regexp.last_match(0)}`" problem "`Use :optional` or `:recommended` instead of `#{Regexp.last_match(0)}`"
end end
return unless line =~ %r{share(\s*[/+]\s*)(['"])#{Regexp.escape(formula.name)}(?:\2|/)} if line =~ %r{share(\s*[/+]\s*)(['"])#{Regexp.escape(formula.name)}(?:\2|/)}
problem "Use pkgshare instead of (share#{Regexp.last_match(1)}\"#{formula.name}\")" problem "Use pkgshare instead of (share#{Regexp.last_match(1)}\"#{formula.name}\")"
end
return unless @core_tap return unless @core_tap
return unless line.include?("env :std") problem "`env :std` in `core` formulae is deprecated" if line.include?("env :std")
problem "`env :std` in `core` formulae is deprecated"
end end
def audit_reverse_migration def audit_reverse_migration