Sha256: e95f8406d1a98e715044363018eeea3921e36bd5db80fc42abbe68452294c9a9

Contents?: true

Size: 816 Bytes

Versions: 12

Compression:

Stored size: 816 Bytes

Contents

# frozen_string_literal: true

module Git
  module Lint
    module Analyzers
      # Analyzes commit trailer signer name capitalization.
      class CommitTrailerSignerCapitalization < Abstract
        include Import[
          pattern: "trailers.signer",
          parser: "parsers.person",
          validator: "validators.capitalization"
        ]

        def valid? = affected_commit_trailers.empty?

        def issue
          return {} if valid?

          {
            hint: "Name must be capitalized.",
            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)
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
git-lint-6.2.1 lib/git/lint/analyzers/commit_trailer_signer_capitalization.rb
git-lint-6.2.0 lib/git/lint/analyzers/commit_trailer_signer_capitalization.rb
git-lint-6.1.0 lib/git/lint/analyzers/commit_trailer_signer_capitalization.rb
git-lint-6.0.2 lib/git/lint/analyzers/commit_trailer_signer_capitalization.rb
git-lint-6.0.1 lib/git/lint/analyzers/commit_trailer_signer_capitalization.rb
git-lint-6.0.0 lib/git/lint/analyzers/commit_trailer_signer_capitalization.rb
git-lint-5.3.0 lib/git/lint/analyzers/commit_trailer_signer_capitalization.rb
git-lint-5.2.0 lib/git/lint/analyzers/commit_trailer_signer_capitalization.rb
git-lint-5.1.2 lib/git/lint/analyzers/commit_trailer_signer_capitalization.rb
git-lint-5.1.1 lib/git/lint/analyzers/commit_trailer_signer_capitalization.rb
git-lint-5.1.0 lib/git/lint/analyzers/commit_trailer_signer_capitalization.rb
git-lint-5.0.0 lib/git/lint/analyzers/commit_trailer_signer_capitalization.rb