Sha256: c77e5753b732ef76e42b81072785ec0b6723e0d0de756ef6af1b2d9295c4e223

Contents?: true

Size: 627 Bytes

Versions: 8

Compression:

Stored size: 627 Bytes

Contents

# frozen_string_literal: true

module Git
  module Lint
    module Analyzers
      # Analyzes author email address for proper format.
      class CommitAuthorEmail < Abstract
        def initialize commit, validator: Validators::Email, **dependencies
          super commit, **dependencies
          @validator = validator
        end

        def valid? = validator.new(commit.author_email).valid?

        def issue
          return {} if valid?

          {hint: %(Use "<name>@<server>.<domain>" instead of "#{commit.author_email}".)}
        end

        private

        attr_reader :validator
      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_email.rb
git-lint-4.5.0 lib/git/lint/analyzers/commit_author_email.rb
git-lint-4.4.0 lib/git/lint/analyzers/commit_author_email.rb
git-lint-4.3.0 lib/git/lint/analyzers/commit_author_email.rb
git-lint-4.2.0 lib/git/lint/analyzers/commit_author_email.rb
git-lint-4.1.0 lib/git/lint/analyzers/commit_author_email.rb
git-lint-4.0.1 lib/git/lint/analyzers/commit_author_email.rb
git-lint-4.0.0 lib/git/lint/analyzers/commit_author_email.rb