Class: RuboCop::Formatter::TapFormatter

Inherits:
ClangStyleFormatter show all
Defined in:
lib/rubocop/formatter/tap_formatter.rb

Overview

This formatter formats report data using the Test Anything Protocol. TAP allows for to communicate tests results in a language agnostics way.

Constant Summary

Constants inherited from ClangStyleFormatter

ClangStyleFormatter::ELLIPSES

Constants inherited from SimpleTextFormatter

SimpleTextFormatter::COLOR_FOR_SEVERITY

Instance Attribute Summary

Attributes inherited from BaseFormatter

#options, #output

Instance Method Summary collapse

Methods inherited from ClangStyleFormatter

#report_file

Methods inherited from SimpleTextFormatter

#finished, #report_file, #report_summary

Methods included from PathUtil

absolute?, match_path?, pwd, relative_path, reset_pwd, smart_path

Methods included from Colorizable

#colorize, #rainbow

Methods inherited from BaseFormatter

#file_started, #finished, #initialize

Constructor Details

This class inherits a constructor from RuboCop::Formatter::BaseFormatter

Instance Method Details

#file_finished(file, offenses) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rubocop/formatter/tap_formatter.rb', line 14

def file_finished(file, offenses)
  if offenses.empty?
    output.puts "ok #{@progress_count} - #{smart_path(file)}"
  else
    output.puts "not ok #{@progress_count} - #{smart_path(file)}"

    count_stats(offenses)
    report_file(file, offenses)
  end

  @progress_count += 1
end

#started(target_files) ⇒ Object



8
9
10
11
12
# File 'lib/rubocop/formatter/tap_formatter.rb', line 8

def started(target_files)
  super
  @progress_count = 1
  output.puts "1..#{target_files.size}"
end