Merge pull request #2627 from MikeMcQuaid/audit-fix-option-detection

audit: fix dependency option detection.
This commit is contained in:
Mike McQuaid 2017-05-14 15:09:07 +01:00 committed by GitHub
commit 75d230318a

View File

@ -1052,8 +1052,12 @@ class FormulaAuditor
problem "#{$2} modules should be vendored rather than use deprecated `depends_on \"#{$1}\" => :#{$2}#{$3}`"
end
if line =~ /depends_on\s+['"](.+)['"]\s+=>\s+.*(?<!\?[( ])['"](.+)['"]/
problem "Dependency #{$1} should not use option #{$2}"
if line =~ /depends_on\s+['"](.+)['"]\s+=>\s+(.*)/
dep = $1
$2.split(" ").map do |o|
next unless o =~ /^\[?['"](.*)['"]/
problem "Dependency #{dep} should not use option #{$1}"
end
end
# Commented-out depends_on