Class: RuboCop::Gradual::Process::Printer

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/gradual/process/printer.rb

Overview

Printer class prints the results of the RuboCop Gradual process.

Instance Method Summary collapse

Constructor Details

#initialize(diff) ⇒ Printer

Returns a new instance of Printer.



8
9
10
# File 'lib/rubocop/gradual/process/printer.rb', line 8

def initialize(diff)
  @diff = diff
end

Instance Method Details



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/rubocop/gradual/process/printer.rb', line 18

def print_ci_warning(diff, statistics:)
  puts "    \\n\#{bold(\"Unexpected Changes!\")}\n\n    RuboCop Gradual lock file is outdated, to fix this message:\n    - Run `rubocop-gradual` locally and commit the results\#{\n      if statistics[:unchanged] != statistics[:left]\n        \", or\\n- EVEN BETTER: before doing the above, try to fix the remaining issues in those files!\"\n      end\n    }\n\n    \#{bold(\"`\#{Configuration.path}` diff:\")}\n\n    \#{diff.to_s(ARGV.include?(\"--no-color\") ? :text : :color)}\n  MSG\nend\n"


12
13
14
15
16
# File 'lib/rubocop/gradual/process/printer.rb', line 12

def print_results
  puts diff.statistics if Configuration.debug?

  send :"print_#{diff.state}"
end