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

audit: check more unscoped test calls.

Also check `def test`, `shell_output`, `pipe_output` and method calls
using parentheses.
parent 89fd34b2
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
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