Sha256: bde1d4e6b0dae25701bab5acd8f9b3ad75d7706276cf302d35509b911e5c4676

Contents?: true

Size: 741 Bytes

Versions: 11

Compression:

Stored size: 741 Bytes

Contents

# frozen_string_literal: true

module Git
  module Lint
    module Analyzers
      class CommitAuthorCapitalization < Abstract
        def self.defaults
          {
            enabled: true,
            severity: :error
          }
        end

        def initialize commit:, settings: self.class.defaults, validator: Validators::Capitalization
          super commit: commit, settings: settings
          @validator = validator
        end

        def valid?
          validator.new(commit.author_name).valid?
        end

        def issue
          return {} if valid?

          {hint: %(Capitalize each part of name: "#{commit.author_name}".)}
        end

        private

        attr_reader :validator
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
git-lint-2.2.1 lib/git/lint/analyzers/commit_author_capitalization.rb
git-lint-2.2.0 lib/git/lint/analyzers/commit_author_capitalization.rb
git-lint-2.1.0 lib/git/lint/analyzers/commit_author_capitalization.rb
git-lint-2.0.0 lib/git/lint/analyzers/commit_author_capitalization.rb
git-lint-1.4.0 lib/git/lint/analyzers/commit_author_capitalization.rb
git-lint-1.3.0 lib/git/lint/analyzers/commit_author_capitalization.rb
git-lint-1.2.0 lib/git/lint/analyzers/commit_author_capitalization.rb
git-lint-1.1.1 lib/git/lint/analyzers/commit_author_capitalization.rb
git-lint-1.1.0 lib/git/lint/analyzers/commit_author_capitalization.rb
git-lint-1.0.1 lib/git/lint/analyzers/commit_author_capitalization.rb
git-lint-1.0.0 lib/git/lint/analyzers/commit_author_capitalization.rb