Class: LintCI::Rubocop::Formatter

Inherits:
RuboCop::Formatter::BaseFormatter
  • Object
show all
Defined in:
lib/lintci/rubocop/formatter.rb

Constant Summary collapse

LINE_FORMAT =
"%s:%d:%d:%d:%s:%s:%s\n"

Instance Method Summary collapse

Instance Method Details

#file_finished(file, offenses) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/lintci/rubocop/formatter.rb', line 8

def file_finished(file, offenses)
  offenses.each do |offense|
    line = offense.line
    column = offense.real_column
    length = offense.location.length

    rule = offense.cop_name
    severity = offense.severity.name
    message = offense.message

    output.printf(LINE_FORMAT, file, line, column, length, rule, severity, message)
  end
end