Class: RuboCop::Kata::Checkup

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/kata/checkup.rb

Constant Summary collapse

INERT =
"%s:%d: `%s` is disabled by the configuration this project inherits; the entry does nothing."
DEAD =
"%s:%d: the directive names `%s`, which is not enabled here; the comment does nothing."
TALLY =
"%d dead entr%s"
KEY =
%r{\A([A-Z]\w*/\w+):}

Instance Method Summary collapse

Constructor Details

#initialize(root, io: $stdout) ⇒ Checkup

Returns a new instance of Checkup.



11
12
13
14
# File 'lib/rubocop/kata/checkup.rb', line 11

def initialize(root, io: $stdout)
  @root = root
  @io = io
end

Instance Method Details

#runObject



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

def run
  found = inert + dead
  found.each { @io.puts(it) }
  @io.puts(found.empty? ? "clean" : tally(found))
  found.empty? ? 0 : 1
end