Skip to content
Snippets Groups Projects
Commit 8d5df2ea authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #1402 from MikeMcQuaid/audit-system-test

audit: check test system calls are fully scoped.
parents 20c8c595 0bd0fec6
No related branches found
No related tags found
No related merge requests found
......@@ -721,6 +721,19 @@ class FormulaAuditor
problem %q(use "xcodebuild *args" instead of "system 'xcodebuild', *args")
end
bin_names = Set.new
bin_names << formula.name
bin_names += formula.aliases
[formula.bin, formula.sbin].each do |dir|
next unless dir.exist?
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}")
end
end
if text =~ /xcodebuild[ (]["'*]/ && !text.include?("SYMROOT=")
problem 'xcodebuild should be passed an explicit "SYMROOT"'
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