aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMike McQuaid2016-11-02 13:23:38 -0400
committerMike McQuaid2016-11-02 13:23:38 -0400
commit7aa26f781707d1836f6dcd9fb82ee70d32e23dcd (patch)
tree108d78ae9198fb6679d52229e17d6bbc1ea0ef67 /Library/Homebrew
parent89fd34b24eed98530010ab31465ef9e3668b5976 (diff)
downloadbrew-7aa26f781707d1836f6dcd9fb82ee70d32e23dcd.tar.bz2
audit: check more unscoped test calls.
Also check `def test`, `shell_output`, `pipe_output` and method calls using parentheses.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index e83cf1b8c..32ff14de1 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -734,8 +734,10 @@ class FormulaAuditor
bin_names += dir.children.map(&:basename).map(&:to_s)
end
bin_names.each do |name|
- if text =~ /test do.*system\s+['"]#{name}/m
- problem %(fully scope test system calls e.g. system "\#{bin}/#{name}")
+ ["system", "shell_output", "pipe_output"].each do |cmd|
+ if text =~ /(def test|test do).*#{cmd}[\(\s]+['"]#{name}/m
+ problem %(fully scope test #{cmd} calls e.g. #{cmd} "\#{bin}/#{name}")
+ end
end
end