Migrate VERSIONED_FORMULAE_CONFLICTS_ALLOWLIST

This commit is contained in:
Rylan Polster 2020-11-27 01:23:19 -05:00
parent 80a46edee4
commit e823dd713e
2 changed files with 1 additions and 7 deletions

View File

@ -12,10 +12,6 @@ module RuboCop
MSG = "Versioned formulae should not use `conflicts_with`. " \
"Use `keg_only :versioned_formula` instead."
ALLOWLIST = %w[
bash-completion@2
].freeze
def audit_formula(_node, _class_node, _parent_class_node, body_node)
find_method_calls_by_name(body_node, :conflicts_with).each do |conflicts_with_call|
next unless parameters(conflicts_with_call).last.respond_to? :values
@ -35,7 +31,7 @@ module RuboCop
return unless versioned_formula?
problem MSG if !ALLOWLIST.include?(@formula_name) &&
problem MSG if !tap_style_exception?(:versioned_formulae_conflicts_allowlist) &&
method_called_ever?(body_node, :conflicts_with)
end

View File

@ -85,6 +85,4 @@ describe RuboCop::Cop::FormulaAudit::Conflicts do
expect(new_source).to eq(corrected_source)
end
end
include_examples "formulae exist", described_class::ALLOWLIST
end