Class: Quality::Tools::Reek

Inherits:
Tool
  • Object
show all
Defined in:
lib/quality/tools/reek.rb

Overview

Adds ‘reek’ tool support to quality gem

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Tool

#initialize

Constructor Details

This class inherits a constructor from Quality::Tools::Tool

Class Method Details

.count_reek_violations(line) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/quality/tools/reek.rb', line 17

def self.count_reek_violations(line)
  if line =~ /^  .* (.*)$/
    1
  else
    0
  end
end

Instance Method Details

#quality_reekObject



7
8
9
10
11
12
13
14
15
# File 'lib/quality/tools/reek.rb', line 7

def quality_reek
  args = "--single-line #{ruby_files.join(' ')}"
  ratchet_quality_cmd('reek',
                      args: args,
                      emacs_format: true,
                      gives_error_code_on_violations: true) do |line|
    self.class.count_reek_violations(line)
  end
end