Sha256: f94323b38c67f52f3ccbc69e2cc31362b00392fd03c1f50d93f54e28aeed03a2

Contents?: true

Size: 660 Bytes

Versions: 8

Compression:

Stored size: 660 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, **dependencies
          super commit, **dependencies
          @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-4.6.0 lib/git/lint/analyzers/commit_author_name.rb
git-lint-4.5.0 lib/git/lint/analyzers/commit_author_name.rb
git-lint-4.4.0 lib/git/lint/analyzers/commit_author_name.rb
git-lint-4.3.0 lib/git/lint/analyzers/commit_author_name.rb
git-lint-4.2.0 lib/git/lint/analyzers/commit_author_name.rb
git-lint-4.1.0 lib/git/lint/analyzers/commit_author_name.rb
git-lint-4.0.1 lib/git/lint/analyzers/commit_author_name.rb
git-lint-4.0.0 lib/git/lint/analyzers/commit_author_name.rb