Sha256: 0932b9b80df2b5d028e52d4d70525287f602f9d2b86d015087c96daea07bc8b8

Contents?: true

Size: 762 Bytes

Versions: 14

Compression:

Stored size: 762 Bytes

Contents

# frozen_string_literal: true

module Git
  module Lint
    module Analyzers
      # Analyzes commit trailer issue key usage.
      class CommitTrailerIssueKey < Abstract
        include Import[setting: "trailers.issue"]

        def valid? = affected_commit_trailers.empty?

        def issue
          return {} if valid?

          {
            hint: "Use format: #{filter_list.to_usage}.",
            lines: affected_commit_trailers
          }
        end

        protected

        def load_filter_list = Kit::FilterList.new setting.name

        def invalid_line? trailer
          trailer.key.then do |key|
            key.match?(setting.pattern) && !key.match?(/\A#{Regexp.union filter_list}\Z/)
          end
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
git-lint-8.8.0 lib/git/lint/analyzers/commit_trailer_issue_key.rb
git-lint-8.7.0 lib/git/lint/analyzers/commit_trailer_issue_key.rb
git-lint-8.6.0 lib/git/lint/analyzers/commit_trailer_issue_key.rb
git-lint-8.5.0 lib/git/lint/analyzers/commit_trailer_issue_key.rb
git-lint-8.4.0 lib/git/lint/analyzers/commit_trailer_issue_key.rb
git-lint-8.3.0 lib/git/lint/analyzers/commit_trailer_issue_key.rb
git-lint-8.2.0 lib/git/lint/analyzers/commit_trailer_issue_key.rb
git-lint-8.1.0 lib/git/lint/analyzers/commit_trailer_issue_key.rb
git-lint-8.0.0 lib/git/lint/analyzers/commit_trailer_issue_key.rb
git-lint-7.5.0 lib/git/lint/analyzers/commit_trailer_issue_key.rb
git-lint-7.3.0 lib/git/lint/analyzers/commit_trailer_issue_key.rb
git-lint-7.2.0 lib/git/lint/analyzers/commit_trailer_issue_key.rb
git-lint-7.1.0 lib/git/lint/analyzers/commit_trailer_issue_key.rb
git-lint-7.0.0 lib/git/lint/analyzers/commit_trailer_issue_key.rb