11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/ruby-appraiser-rubocop.rb', line 11
def appraise
file_args = Shellwords::join(relevant_files)
file_args = '**/*.rb' if file_args.length > 250_000
rubocop_command = ['rubocop --emacs',
file_args].flatten.join(' ')
puts rubocop_command if @options[:verbose]
rubocop_output = IO.popen(rubocop_command) { |io| io.read }
rubocop_output.lines.each do |rubocop_outut_line|
next unless rubocop_outut_line.match(/^([^:]+):([0-9]+)(.*)/)
file = Regexp::last_match(1)
line = Regexp::last_match(2).to_i
desc = Regexp::last_match(3).strip
add_defect(file, line, desc)
end
end
|