From 17e55ead73593ef3897ca484b0e5b38e88a1e7bf Mon Sep 17 00:00:00 2001 From: commitay Date: Wed, 24 Oct 2018 13:54:05 +1000 Subject: [PATCH] audit: check for `bottle do` blocks in new formulae --- Library/Homebrew/dev-cmd/audit.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index cb85005b08..c33d288106 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -254,6 +254,7 @@ module Homebrew def initialize(formula, options = {}) @formula = formula @versioned_formula = formula.versioned_formula? + @new_formula_inclusive = options[:new_formula] @new_formula = options[:new_formula] && !@versioned_formula @strict = options[:strict] @online = options[:online] @@ -563,6 +564,18 @@ module Homebrew end end + def audit_bottle_spec + # special case: new versioned formulae should be audited + return unless @new_formula_inclusive + return unless @core_tap + + return if formula.bottle_disabled? + + return unless formula.bottle_defined? + + new_formula_problem "New formulae should not have a `bottle do` block" + end + def audit_bottle_disabled return unless formula.bottle_disabled? return if formula.bottle_unneeded?