Class: Git::Lint::Analyzers::CommitBodyWordRepeat
- Defined in:
- lib/git/lint/analyzers/commit_body_word_repeat.rb
Overview
Analyzes commit body for repeated words.
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
12 13 14 15 16 17 18 19 |
# File 'lib/git/lint/analyzers/commit_body_word_repeat.rb', line 12 def issue return {} if valid? { hint: "Avoid repeating these words: #{validator.call commit.body}.", lines: affected_commit_body_lines } end |
#valid? ⇒ Boolean
10 |
# File 'lib/git/lint/analyzers/commit_body_word_repeat.rb', line 10 def valid? = commit.body_lines.all? { |line| !invalid_line? line } |