Sha256: dadf5e6e438ca880cbe7bb7d44740e3a61f5b42e8b169a32bbc6952fecd18270

Contents?: true

Size: 737 Bytes

Versions: 11

Compression:

Stored size: 737 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?
        end

        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

11 entries across 11 versions & 1 rubygems

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