Sha256: 176b48a38266d94cf6543e21635c66738fb19fb96c441f5bda5c95a3bd76f2b9

Contents?: true

Size: 628 Bytes

Versions: 8

Compression:

Stored size: 628 Bytes

Contents

# frozen_string_literal: true

module Git
  module Lint
    module Analyzers
      # Analyzes author name for minimum parts of name.
      class CommitAuthorName < Abstract
        def initialize commit, validator: Validators::Name
          super commit
          @validator = validator
        end

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

        def issue
          return {} if valid?

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

        private

        attr_reader :validator

        def minimum = settings.minimum
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
git-lint-3.3.2 lib/git/lint/analyzers/commit_author_name.rb
git-lint-3.3.1 lib/git/lint/analyzers/commit_author_name.rb
git-lint-3.3.0 lib/git/lint/analyzers/commit_author_name.rb
git-lint-3.2.0 lib/git/lint/analyzers/commit_author_name.rb
git-lint-3.1.0 lib/git/lint/analyzers/commit_author_name.rb
git-lint-3.0.2 lib/git/lint/analyzers/commit_author_name.rb
git-lint-3.0.1 lib/git/lint/analyzers/commit_author_name.rb
git-lint-3.0.0 lib/git/lint/analyzers/commit_author_name.rb