class Git::Lint::Reporters::Commit
Reports issues related to a single commit.
Attributes
analyzers[R]
commit[R]
Public Class Methods
new(commit:, analyzers: [])
click to toggle source
# File lib/git/lint/reporters/commit.rb, line 8 def initialize commit:, analyzers: [] @commit = commit @analyzers = analyzers.select(&:invalid?) end
Public Instance Methods
to_s()
click to toggle source
# File lib/git/lint/reporters/commit.rb, line 13 def to_s return "" if analyzers.empty? "#{commit.sha} (#{commit.author_name}, #{commit.author_date_relative}): " \ "#{commit.subject}\n#{report}\n" end
Private Instance Methods
report(= analyzers.reduce("") { |report, analyzer| report + Style.new(analyzer).to_s })
click to toggle source
# File lib/git/lint/reporters/commit.rb, line 24 def report = analyzers.reduce("") { |report, analyzer| report + Style.new(analyzer).to_s } end