Skip to content

Commit

Permalink
audit: check virtualenv and setuptools resource.
Browse files Browse the repository at this point in the history
`virtualenv_install_with_resources` will automatically define and
install a `setuptools` resource so this is unnecessary.

References Homebrew/homebrew-core#8570
  • Loading branch information
MikeMcQuaid committed Jan 9, 2017
1 parent f7bccee commit 346d68e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Library/Homebrew/dev-cmd/audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,11 @@ def audit_text
problem "Formulae should not depend on both OpenSSL and LibreSSL (even optionally)."
end

if text =~ /virtualenv_(create|install_with_resources)/ &&
text =~ /resource\s+['"]setuptools['"]\s+do/
problem "Formulae using virtualenvs do not need a `setuptools` resource."
end

return unless text.include?('require "language/go"') && !text.include?("go_resource")
problem "require \"language/go\" is unnecessary unless using `go_resource`s"
end
Expand Down

0 comments on commit 346d68e

Please sign in to comment.