Class: Git::Lint::Analyzers::CommitAuthorCapitalization

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

Overview

Analyzes author name for proper capitalization.

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



12
13
14
15
16
# File 'lib/git/lint/analyzers/commit_author_capitalization.rb', line 12

def issue
  return {} if valid?

  {hint: %(Capitalize each part of name: "#{commit.author_name}".)}
end

#valid?Boolean

Returns:

  • (Boolean)


10
# File 'lib/git/lint/analyzers/commit_author_capitalization.rb', line 10

def valid? = validator.call commit.author_name