Class: RuboCop::Formatter::EmacsStyleFormatter
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
BaseFormatter
|
|
Instance Chain:
self,
BaseFormatter
|
|
Inherits: |
RuboCop::Formatter::BaseFormatter
|
Defined in: | lib/rubocop/formatter/emacs_style_formatter.rb |
Overview
This formatter displays the report data in format that’s easy to process in the Emacs text editor. The output is machine-parsable.
Class Method Summary
BaseFormatter
- Inherited
Instance Attribute Summary
BaseFormatter
- Inherited
Instance Method Summary
BaseFormatter
- Inherited
#file_finished | Invoked at the end of inspecting each files. |
#file_started | Invoked at the beginning of inspecting each files. |
#finished | Invoked after all files are inspected or interrupted by user. |
#started | Invoked once before any files are inspected. |
Constructor Details
This class inherits a constructor from RuboCop::Formatter::BaseFormatter
Instance Method Details
#file_finished(file, offenses)
[ GitHub ]# File 'lib/rubocop/formatter/emacs_style_formatter.rb', line 9
def file_finished(file, offenses) offenses.each do |o| output.printf( "%<path>s:%<line>d:%<column>d: %<severity>s: %<message>s\n", path: file, line: o.line, column: o.real_column, severity: o.severity.code, message: (o) ) end end
#message(offense) (private)
[ GitHub ]# File 'lib/rubocop/formatter/emacs_style_formatter.rb', line 24
def (offense) = if offense.corrected_with_todo? "[Todo] #{offense.}" elsif offense.corrected? "[Corrected] #{offense.}" elsif offense.correctable? "[Correctable] #{offense.}" else offense. end .tr("\n", ' ') end