Sha256: f63644e8e09a04b0a8d73b9d29430acf625180fb799bd913776eb5faa712c07a

Contents?: true

Size: 717 Bytes

Versions: 5

Compression:

Stored size: 717 Bytes

Contents

# frozen_string_literal: true

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

        def initialize commit:, settings: self.class.defaults, validator: Validators::Email
          super commit: commit, settings: settings
          @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

5 entries across 5 versions & 1 rubygems

Version Path
git-lint-2.4.0 lib/git/lint/analyzers/commit_author_email.rb
git-lint-2.3.3 lib/git/lint/analyzers/commit_author_email.rb
git-lint-2.3.2 lib/git/lint/analyzers/commit_author_email.rb
git-lint-2.3.1 lib/git/lint/analyzers/commit_author_email.rb
git-lint-2.3.0 lib/git/lint/analyzers/commit_author_email.rb