Sha256: 27d632ee4aa68cd1edbd5c3d7bb013a4bd52bdab5b77da1b4b3f4208f8cb94b0

Contents?: true

Size: 595 Bytes

Versions: 8

Compression:

Stored size: 595 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
          super commit
          @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-3.3.2 lib/git/lint/analyzers/commit_author_email.rb
git-lint-3.3.1 lib/git/lint/analyzers/commit_author_email.rb
git-lint-3.3.0 lib/git/lint/analyzers/commit_author_email.rb
git-lint-3.2.0 lib/git/lint/analyzers/commit_author_email.rb
git-lint-3.1.0 lib/git/lint/analyzers/commit_author_email.rb
git-lint-3.0.2 lib/git/lint/analyzers/commit_author_email.rb
git-lint-3.0.1 lib/git/lint/analyzers/commit_author_email.rb
git-lint-3.0.0 lib/git/lint/analyzers/commit_author_email.rb