audit: check for HOMEBREW_PREFIX test path usage.
This is also not allowed. As seen in https://github.com/Homebrew/homebrew-core/pull/6996.
This commit is contained in:
parent
5bbc610d2c
commit
e4fb108079
@ -760,7 +760,7 @@ class FormulaAuditor
|
|||||||
end
|
end
|
||||||
bin_names.each do |name|
|
bin_names.each do |name|
|
||||||
["system", "shell_output", "pipe_output"].each do |cmd|
|
["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}")
|
problem %Q(fully scope test #{cmd} calls e.g. #{cmd} "\#{bin}/#{name}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user