Class: WhyClasses::Formatters::ClangFormatter

Inherits:
BaseFormatter show all
Defined in:
lib/why_classes/formatters/clang_formatter.rb

Overview

One line per offense: path:line:col: [Rule] message. Editor/CI friendly.

Instance Method Summary collapse

Methods inherited from BaseFormatter

#initialize

Constructor Details

This class inherits a constructor from WhyClasses::Formatters::BaseFormatter

Instance Method Details

#call(reports) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/why_classes/formatters/clang_formatter.rb', line 9

def call(reports)
  reports.each do |report|
    report.offenses.each do |offense|
      io.puts "#{report.path}:#{offense.line}:#{offense.column + 1}: " \
              "[#{offense.rule_name}] #{offense.message}"
    end
  end
end