module Dry::Schema::Extensions::Hints::MessageCompilerMethods

def exclude?(messages, opts)

Other tags:
    Api: - private
def exclude?(messages, opts)
  Array(messages).all? do |msg|
    hints = opts.hints.reject { |h|
      msg.eql?(h) || h.predicate.eql?(:filled?)
    }
    key_failure = opts.key_failure?(msg.path)
    predicate = msg.predicate
    (HINT_TYPE_EXCLUSION.include?(predicate) && !key_failure) ||
      (msg.predicate == :filled? && key_failure) ||
      (!key_failure && HINT_TYPE_EXCLUSION.include?(predicate) &&
        !hints.empty? && hints.any? { |hint| hint.path == msg.path }) ||
      HINT_OTHER_EXCLUSION.include?(predicate)
  end
end