Sha256: 9af04fd12607e40fa101d3166bc3cd4b7d177de664984a04ffdf08c37a248ebe

Contents?: true

Size: 580 Bytes

Versions: 6

Compression:

Stored size: 580 Bytes

Contents

# frozen_string_literal: true

module Git
  module Lint
    module Analyzers
      # Analyzes commit signature validity.
      class CommitSignature < Abstract
        include Import[sanitizer: "sanitizers.signature"]

        def valid?
          sanitizer.call(commit.signature).match?(/\A#{Regexp.union filter_list.to_regexp}\Z/)
        end

        def issue = valid? ? {} : {hint: %(Use: #{filter_list.to_hint}.)}

        protected

        def load_filter_list
          Kit::FilterList.new configuration.commits_signature_includes
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
git-lint-6.2.1 lib/git/lint/analyzers/commit_signature.rb
git-lint-6.2.0 lib/git/lint/analyzers/commit_signature.rb
git-lint-6.1.0 lib/git/lint/analyzers/commit_signature.rb
git-lint-6.0.2 lib/git/lint/analyzers/commit_signature.rb
git-lint-6.0.1 lib/git/lint/analyzers/commit_signature.rb
git-lint-6.0.0 lib/git/lint/analyzers/commit_signature.rb