Skip to content
Snippets Groups Projects
Commit e4fb1080 authored by Mike McQuaid's avatar Mike McQuaid
Browse files

audit: check for HOMEBREW_PREFIX test path usage.

This is also not allowed.

As seen in https://github.com/Homebrew/homebrew-core/pull/6996.
parent 5bbc610d
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment