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

audit: fix dependency option detection.

Instead of trying to do this all with a single regex give up and do a
two stage process. Eventually I'll end up implementing a full ruby
parser here :troll:.
parent 459fef3b
No related branches found
No related tags found
No related merge requests found
......@@ -1036,8 +1036,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
......
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