Class: Git::Lint::Analyzers::CommitBodyBulletOnly

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

Overview

Analyzes commit bodies with only a single bullet point.

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



10
11
12
13
14
15
16
17
# File 'lib/git/lint/analyzers/commit_body_bullet_only.rb', line 10

def issue
  return {} if valid?

  {
    hint: "Use paragraph instead of single bullet.",
    lines: affected_commit_body_lines
  }
end

#valid?Boolean

Returns:

  • (Boolean)


8
# File 'lib/git/lint/analyzers/commit_body_bullet_only.rb', line 8

def valid? = !affected_commit_body_lines.one?