Class: OpenvoxLint::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/openvox-lint/report.rb

Overview

Formats and outputs lint problems in the requested format.

Constant Summary collapse

SEVERITIES =
{ warning: 'WARNING', error: 'ERROR' }.freeze

Instance Method Summary collapse

Constructor Details

#initialize(configuration) ⇒ Report

Returns a new instance of Report.



10
11
12
# File 'lib/openvox-lint/report.rb', line 10

def initialize(configuration)
  @config = configuration
end

Instance Method Details

#format(problems, io: $stdout) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/openvox-lint/report.rb', line 14

def format(problems, io: $stdout)
  case @config.log_format
  when 'json'        then format_json(problems, io)
  when 'csv'         then format_csv(problems, io)
  when 'github'      then format_github(problems, io)
  when 'codeclimate' then format_codeclimate(problems, io)
  when 'custom'      then format_custom(problems, io)
  else                    format_text(problems, io)
  end
end