rubocop/conflicts: use full name in whitelist.

This commit is contained in:
Mike McQuaid 2020-04-11 14:19:04 +01:00
parent c5b8983da4
commit 2e74e50f82
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

View File

@ -12,13 +12,13 @@ module RuboCop
"Use `keg_only :versioned_formula` instead."
WHITELIST = %w[
bash-completion@
bash-completion@2
].freeze
def audit_formula(_node, _class_node, _parent_class_node, body)
return unless versioned_formula?
problem MSG if !@formula_name.start_with?(*WHITELIST) &&
problem MSG if !WHITELIST.include?(@formula_name) &&
method_called_ever?(body, :conflicts_with)
end
end