Sha256: 1a5a74364069b29326a5bee465702a7bfeef2251300c4c46cfba8e1c2c63b8d3
Contents?: true
Size: 932 Bytes
Versions: 6
Compression:
Stored size: 932 Bytes
Contents
# frozen_string_literal: true module Git module Lint module Analyzers # Analyzes commit trailer signer name construction. class CommitTrailerSignerName < Abstract include Import[ pattern: "trailers.signer", parser: "parsers.person", validator: "validators.name" ] def valid? = affected_commit_trailers.empty? def issue return {} if valid? { hint: "Name must follow key and consist of #{minimum} parts (minimum).", lines: affected_commit_trailers } end protected def invalid_line? trailer parser.call(trailer.value).then do |person| trailer.key.match?(pattern) && !validator.call(person.name, minimum:) end end private def minimum = configuration.commits_trailer_signer_name_minimum end end end end
Version data entries
6 entries across 6 versions & 1 rubygems