Class: Git::Lint::Analyzers::CommitSignature

Inherits:
Abstract
  • Object
show all
Defined in:
lib/git/lint/analyzers/commit_signature.rb

Overview

Analyzes commit signature validity.

Constant Summary

Constants inherited from Abstract

Abstract::BODY_OFFSET, Abstract::LEVELS

Instance Attribute Summary

Attributes inherited from Abstract

#commit

Instance Method Summary collapse

Methods inherited from Abstract

build_issue_line, #error?, id, #initialize, #invalid?, label, #severity, #warning?

Constructor Details

This class inherits a constructor from Git::Lint::Analyzers::Abstract

Instance Method Details

#issueObject



14
# File 'lib/git/lint/analyzers/commit_signature.rb', line 14

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

#valid?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/git/lint/analyzers/commit_signature.rb', line 10

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