audit: check the use of Dir[]

Sometimes `Dir[]` is used with single files/directories unnecessarily.
This commit is contained in:
Mike McQuaid 2014-03-29 09:16:27 -05:00
parent 94f324d778
commit bf8ff2dcb7

View File

@ -525,6 +525,10 @@ class FormulaAuditor
if line =~ /depends_on ['"](.+)['"] (if.+|unless.+)$/
audit_conditional_dep($1, $2, $&)
end
if line =~ /(Dir\[("[^\*{},]+")\])/
problem "#{$1} is unnecessary; just use #{$2}"
end
end
def audit_conditional_dep(dep, condition, line)