From 346d68eb04013d2322796ed1a0edd7de007a156d Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 9 Jan 2017 13:24:51 +0000 Subject: [PATCH] audit: check virtualenv and setuptools resource. `virtualenv_install_with_resources` will automatically define and install a `setuptools` resource so this is unnecessary. References https://github.com/Homebrew/homebrew-core/pull/8570 --- Library/Homebrew/dev-cmd/audit.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 6d43c51bfee0c..744aa6fbee71a 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -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