Class: Git::Lint::Reporters::Commit
- Inherits:
-
Object
- Object
- Git::Lint::Reporters::Commit
- Defined in:
- lib/git/lint/reporters/commit.rb
Overview
Reports issues related to a single commit.
Instance Method Summary collapse
-
#initialize(commit:, analyzers: []) ⇒ Commit
constructor
A new instance of Commit.
- #to_s ⇒ Object (also: #to_str)
Constructor Details
#initialize(commit:, analyzers: []) ⇒ Commit
Returns a new instance of Commit.
8 9 10 11 |
# File 'lib/git/lint/reporters/commit.rb', line 8 def initialize commit:, analyzers: [] @commit = commit @analyzers = analyzers.select(&:invalid?) end |
Instance Method Details
#to_s ⇒ Object Also known as: to_str
13 14 15 16 17 18 |
# File 'lib/git/lint/reporters/commit.rb', line 13 def to_s return "" if analyzers.empty? "#{commit.sha} (#{commit.}, #{commit.}): " \ "#{commit.subject}\n#{report}\n" end |