Merge pull request #1530 from MikeMcQuaid/audit-homebrew-prefix-test-path

audit: check for HOMEBREW_PREFIX test path usage.
This commit is contained in:
Mike McQuaid 2016-11-18 12:37:46 +00:00 committed by GitHub
commit f4810e4eb1

View File

@ -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