Class: Git::Lint::Analyzers::CommitBodyPresence
- Defined in:
- lib/git/lint/analyzers/commit_body_presence.rb
Overview
Analyzes presence of commit body.
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
19 20 21 22 23 |
# File 'lib/git/lint/analyzers/commit_body_presence.rb', line 19 def issue return {} if valid? {hint: %(Use minimum of #{"#{minimum} line".pluralize "s", minimum} (non-empty).)} end |
#minimum ⇒ Object
17 |
# File 'lib/git/lint/analyzers/commit_body_presence.rb', line 17 def minimum = settings.commits_body_presence_minimum |
#valid? ⇒ Boolean
10 11 12 13 14 15 |
# File 'lib/git/lint/analyzers/commit_body_presence.rb', line 10 def valid? return true if commit.fixup? valid_lines = commit.body_lines.grep_v(/^\s*$/) valid_lines.size >= minimum end |