Class: Git::Lint::Analyzers::CommitSubjectSuffix
- Defined in:
- lib/git/lint/analyzers/commit_subject_suffix.rb
Overview
Analyzes commit subject suffix for punctuation.
Constant Summary
Constants inherited from Abstract
Abstract::BODY_OFFSET, Abstract::LEVELS
Instance Attribute Summary
Attributes inherited from Abstract
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
#issue ⇒ Object
14 15 16 17 18 |
# File 'lib/git/lint/analyzers/commit_subject_suffix.rb', line 14 def issue return {} if valid? {hint: %(Avoid: #{filter_list.to_usage}.)} end |
#valid? ⇒ Boolean
8 9 10 11 12 |
# File 'lib/git/lint/analyzers/commit_subject_suffix.rb', line 8 def valid? return true if filter_list.empty? !commit.subject.match?(/#{Regexp.union filter_list}\Z/) end |