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:
parent
0731a68cde
commit
6a0086a0a7
@ -959,6 +959,7 @@ class FormulaAuditor
|
|||||||
if line =~ /depends_on\s+['"](.+)['"]\s+=>\s+(.*)/
|
if line =~ /depends_on\s+['"](.+)['"]\s+=>\s+(.*)/
|
||||||
dep = $1
|
dep = $1
|
||||||
$2.split(" ").map do |o|
|
$2.split(" ").map do |o|
|
||||||
|
break if ["if", "unless"].include?(o)
|
||||||
next unless o =~ /^\[?['"](.*)['"]/
|
next unless o =~ /^\[?['"](.*)['"]/
|
||||||
problem "Dependency #{dep} should not use option #{$1}"
|
problem "Dependency #{dep} should not use option #{$1}"
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user