Merge pull request #4408 from commitay/dependency_order

audit: exempt versioned formulae from new formula audit
This commit is contained in:
Mike McQuaid 2018-07-03 08:28:02 +01:00 committed by GitHub
commit f63ea00c29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -216,7 +216,7 @@ module Homebrew
def initialize(formula, options = {}) def initialize(formula, options = {})
@formula = formula @formula = formula
@new_formula = options[:new_formula] @new_formula = options[:new_formula] && !formula.versioned_formula?
@strict = options[:strict] @strict = options[:strict]
@online = options[:online] @online = options[:online]
@display_cop_names = options[:display_cop_names] @display_cop_names = options[:display_cop_names]
@ -236,6 +236,7 @@ module Homebrew
return unless @style_offenses return unless @style_offenses
@style_offenses.each do |offense| @style_offenses.each do |offense|
if offense.cop_name.start_with?("NewFormulaAudit") if offense.cop_name.start_with?("NewFormulaAudit")
next if formula.versioned_formula?
new_formula_problem offense.to_s(display_cop_name: @display_cop_names) new_formula_problem offense.to_s(display_cop_name: @display_cop_names)
next next
end end
@ -416,7 +417,6 @@ module Homebrew
end end
next unless @new_formula next unless @new_formula
next if formula.versioned_formula?
next unless @official_tap next unless @official_tap
if dep.tags.include?(:recommended) || dep.tags.include?(:optional) if dep.tags.include?(:recommended) || dep.tags.include?(:optional)
new_formula_problem "Formulae should not have #{dep.tags} dependencies." new_formula_problem "Formulae should not have #{dep.tags} dependencies."

View File

@ -50,7 +50,6 @@ module RuboCop
OPTION = "Formulae should not have an `option`".freeze OPTION = "Formulae should not have an `option`".freeze
def audit_formula(_node, _class_node, _parent_class_node, body_node) 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) problem DEP_OPTION if method_called_ever?(body_node, :deprecated_option)
return unless formula_tap == "homebrew-core" return unless formula_tap == "homebrew-core"
problem OPTION if method_called_ever?(body_node, :option) problem OPTION if method_called_ever?(body_node, :option)