diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index d0e1e25494..d918b48c5a 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -216,7 +216,7 @@ module Homebrew def initialize(formula, options = {}) @formula = formula - @new_formula = options[:new_formula] + @new_formula = options[:new_formula] && !formula.versioned_formula? @strict = options[:strict] @online = options[:online] @display_cop_names = options[:display_cop_names] @@ -236,6 +236,7 @@ module Homebrew return unless @style_offenses @style_offenses.each do |offense| if offense.cop_name.start_with?("NewFormulaAudit") + next if formula.versioned_formula? new_formula_problem offense.to_s(display_cop_name: @display_cop_names) next end @@ -416,7 +417,6 @@ module Homebrew end next unless @new_formula - next if formula.versioned_formula? next unless @official_tap if dep.tags.include?(:recommended) || dep.tags.include?(:optional) new_formula_problem "Formulae should not have #{dep.tags} dependencies." diff --git a/Library/Homebrew/rubocops/options_cop.rb b/Library/Homebrew/rubocops/options_cop.rb index 400ea807bb..c39709d7b5 100644 --- a/Library/Homebrew/rubocops/options_cop.rb +++ b/Library/Homebrew/rubocops/options_cop.rb @@ -50,7 +50,6 @@ module RuboCop OPTION = "Formulae should not have an `option`".freeze def audit_formula(_node, _class_node, _parent_class_node, body_node) - return if versioned_formula? problem DEP_OPTION if method_called_ever?(body_node, :deprecated_option) return unless formula_tap == "homebrew-core" problem OPTION if method_called_ever?(body_node, :option)