Sha256: c5a228e7c1763ee59a36b2cfdcb8bfc404acaaee1c281097f6d2421f09032a1f

Contents?: true

Size: 516 Bytes

Versions: 6

Compression:

Stored size: 516 Bytes

Contents

# frozen_string_literal: true

module Git
  module Lint
    module Analyzers
      # Analyzes author name for minimum parts of name.
      class CommitAuthorName < Abstract
        include Import[validator: "validators.name"]

        def valid? = validator.call(commit.author_name, minimum:)

        def issue
          return {} if valid?

          {hint: "Author name must consist of #{minimum} parts (minimum)."}
        end

        private

        def minimum = settings.minimum
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
git-lint-5.3.0 lib/git/lint/analyzers/commit_author_name.rb
git-lint-5.2.0 lib/git/lint/analyzers/commit_author_name.rb
git-lint-5.1.2 lib/git/lint/analyzers/commit_author_name.rb
git-lint-5.1.1 lib/git/lint/analyzers/commit_author_name.rb
git-lint-5.1.0 lib/git/lint/analyzers/commit_author_name.rb
git-lint-5.0.0 lib/git/lint/analyzers/commit_author_name.rb