Sha256: ff381d73821affd0e104a76dadea5b931dbb349e5beca67ce62c50e0570bdb9e
Contents?: true
Size: 975 Bytes
Versions: 8
Compression:
Stored size: 975 Bytes
Contents
# frozen_string_literal: true module Git module Lint module Analyzers # Analyzes commit trailer collaborator email address format. class CommitTrailerCollaboratorEmail < Abstract def initialize commit, parser: Parsers::Trailers::Collaborator, validator: Validators::Email super commit @parser = parser @validator = validator end def valid? = affected_commit_trailers.empty? def issue return {} if valid? { hint: %(Email must follow name and use format: "<name@server.domain>".), lines: affected_commit_trailers } end protected def invalid_line? line collaborator = parser.new line collaborator.match? && !validator.new(collaborator.email).valid? end private attr_reader :parser, :validator end end end end
Version data entries
8 entries across 8 versions & 1 rubygems