audit: fix false negative for formulae options.

Handle the case where an if/unless is detected and then write off this
line for option handling.
This commit is contained in:
Mike McQuaid 2017-06-02 22:26:37 +01:00
parent 0731a68cde
commit 6a0086a0a7

View File

@ -959,6 +959,7 @@ class FormulaAuditor
if line =~ /depends_on\s+['"](.+)['"]\s+=>\s+(.*)/
dep = $1
$2.split(" ").map do |o|
break if ["if", "unless"].include?(o)
next unless o =~ /^\[?['"](.*)['"]/
problem "Dependency #{dep} should not use option #{$1}"
end