Class: RuboCop::Formatter::DisabledLinesFormatter

Inherits:
BaseFormatter
  • Object
show all
Includes:
Colorizable, PathUtil
Defined in:
lib/rubocop/formatter/disabled_lines_formatter.rb

Overview

A basic formatter that displays the lines disabled inline comments.

Instance Attribute Summary collapse

Attributes inherited from BaseFormatter

#output

Instance Method Summary collapse

Methods included from Colorizable

#colorize, #rainbow

Methods included from PathUtil

hidden?, issue_deprecation_warning, match_path?, relative_path

Methods inherited from BaseFormatter

#file_finished, #initialize

Constructor Details

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

Instance Attribute Details

#cop_disabled_line_rangesObject (readonly)

Returns the value of attribute cop_disabled_line_ranges.



10
11
12
# File 'lib/rubocop/formatter/disabled_lines_formatter.rb', line 10

def cop_disabled_line_ranges
  @cop_disabled_line_ranges
end

Instance Method Details

#file_started(file, options) ⇒ Object



16
17
18
19
20
21
# File 'lib/rubocop/formatter/disabled_lines_formatter.rb', line 16

def file_started(file, options)
  return unless options[:cop_disabled_line_ranges]

  @cop_disabled_line_ranges[file] =
    options[:cop_disabled_line_ranges]
end

#finished(_inspected_files) ⇒ Object



23
24
25
# File 'lib/rubocop/formatter/disabled_lines_formatter.rb', line 23

def finished(_inspected_files)
  cops_disabled_in_comments_summary
end

#started(_target_files) ⇒ Object



12
13
14
# File 'lib/rubocop/formatter/disabled_lines_formatter.rb', line 12

def started(_target_files)
  @cop_disabled_line_ranges = {}
end