Sha256: cff47e05e12a05669517d0675cfb962594d517b80d3d038da0b261a8ae71595c

Contents?: true

Size: 509 Bytes

Versions: 27

Compression:

Stored size: 509 Bytes

Contents

# frozen_string_literal: true

module Git
  module Lint
    module Analyzers
      # Analyzes commit trailer duplicate.
      class CommitTrailerDuplicate < Abstract
        def valid? = affected_commit_trailers.empty?

        def issue
          return {} if valid?

          {
            hint: "Avoid duplicates.",
            lines: affected_commit_trailers
          }
        end

        protected

        def invalid_line?(trailer) = commit.trailers.tally[trailer] != 1
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
git-lint-9.0.0 lib/git/lint/analyzers/commit_trailer_duplicate.rb
git-lint-8.8.0 lib/git/lint/analyzers/commit_trailer_duplicate.rb
git-lint-8.7.0 lib/git/lint/analyzers/commit_trailer_duplicate.rb
git-lint-8.6.0 lib/git/lint/analyzers/commit_trailer_duplicate.rb
git-lint-8.5.0 lib/git/lint/analyzers/commit_trailer_duplicate.rb
git-lint-8.4.0 lib/git/lint/analyzers/commit_trailer_duplicate.rb
git-lint-8.3.0 lib/git/lint/analyzers/commit_trailer_duplicate.rb
git-lint-8.2.0 lib/git/lint/analyzers/commit_trailer_duplicate.rb
git-lint-8.1.0 lib/git/lint/analyzers/commit_trailer_duplicate.rb
git-lint-8.0.0 lib/git/lint/analyzers/commit_trailer_duplicate.rb
git-lint-7.5.0 lib/git/lint/analyzers/commit_trailer_duplicate.rb
git-lint-7.3.0 lib/git/lint/analyzers/commit_trailer_duplicate.rb
git-lint-7.2.0 lib/git/lint/analyzers/commit_trailer_duplicate.rb
git-lint-7.1.0 lib/git/lint/analyzers/commit_trailer_duplicate.rb
git-lint-7.0.0 lib/git/lint/analyzers/commit_trailer_duplicate.rb
git-lint-6.2.1 lib/git/lint/analyzers/commit_trailer_duplicate.rb
git-lint-6.2.0 lib/git/lint/analyzers/commit_trailer_duplicate.rb
git-lint-6.1.0 lib/git/lint/analyzers/commit_trailer_duplicate.rb
git-lint-6.0.2 lib/git/lint/analyzers/commit_trailer_duplicate.rb
git-lint-6.0.1 lib/git/lint/analyzers/commit_trailer_duplicate.rb