From 8221e32ad4c41a511cb08fd2cc0318123b1aa163 Mon Sep 17 00:00:00 2001 From: George Waters Date: Wed, 13 Nov 2019 15:52:58 -0500 Subject: [PATCH] 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. --- Library/Homebrew/dev-cmd/audit.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 5a55cee94e..f582bb03bf 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -948,15 +948,13 @@ module Homebrew problem "`Use :optional` or `:recommended` instead of `#{Regexp.last_match(0)}`" end - return unless line =~ %r{share(\s*[/+]\s*)(['"])#{Regexp.escape(formula.name)}(?:\2|/)} - - problem "Use pkgshare instead of (share#{Regexp.last_match(1)}\"#{formula.name}\")" + if line =~ %r{share(\s*[/+]\s*)(['"])#{Regexp.escape(formula.name)}(?:\2|/)} + problem "Use pkgshare instead of (share#{Regexp.last_match(1)}\"#{formula.name}\")" + end return unless @core_tap - return unless line.include?("env :std") - - problem "`env :std` in `core` formulae is deprecated" + problem "`env :std` in `core` formulae is deprecated" if line.include?("env :std") end def audit_reverse_migration