Merge pull request #4033 from MikeMcQuaid/audit-depend-if-build-with

audit (strict): check for build.with? dependencies.
This commit is contained in:
Mike McQuaid 2018-04-08 22:54:07 +01:00 committed by GitHub
commit b584e24ad1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -736,6 +736,10 @@ class FormulaAuditor
problem "Use \#{pkgshare} instead of \#{share}/#{formula.name}"
end
if line =~ /depends_on .+ if build\.with(out)?\?\(?["']\w+["']\)?/
problem "`Use :optional` or `:recommended` instead of `#{Regexp.last_match(0)}`"
end
return unless line =~ %r{share(\s*[/+]\s*)(['"])#{Regexp.escape(formula.name)}(?:\2|/)}
problem "Use pkgshare instead of (share#{Regexp.last_match(1)}\"#{formula.name}\")"
end