From e4fb108079352fb89105cb34a975a18015eee6bc Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 17 Nov 2016 17:31:31 +0000 Subject: [PATCH] audit: check for HOMEBREW_PREFIX test path usage. This is also not allowed. As seen in https://github.com/Homebrew/homebrew-core/pull/6996. --- Library/Homebrew/dev-cmd/audit.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index df3b5fafe7..08e9a85802 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -760,7 +760,7 @@ class FormulaAuditor end bin_names.each do |name| ["system", "shell_output", "pipe_output"].each do |cmd| - if text =~ /(def test|test do).*#{cmd}[\(\s]+['"]#{Regexp.escape name}[\s'"]/m + if text =~ %r{(def test|test do).*(#{Regexp.escape HOMEBREW_PREFIX}/bin/)?#{cmd}[\(\s]+['"]#{Regexp.escape name}[\s'"]}m problem %Q(fully scope test #{cmd} calls e.g. #{cmd} "\#{bin}/#{name}") end end