lib/quality/tools/rubocop.rb in quality-32.1.1 vs lib/quality/tools/rubocop.rb in quality-33.0.0
- old
+ new
@@ -1,17 +1,11 @@
# frozen_string_literal: true
module Quality
module Tools
# Adds 'rubocop' tool support to quality gem
- module Rubocop
- def self.included(base)
- base.extend ClassMethods
- end
-
- private
-
+ class Rubocop < Tool
def rubocop_args
[
'--force-exclusion',
'--require rubocop-rspec',
'--format emacs',
@@ -25,20 +19,17 @@
args: rubocop_args) do |line|
self.class.count_rubocop_violations(line)
end
end
- # See Rubocop.included
- module ClassMethods
- def count_rubocop_violations(line)
- if line =~ /^.* file[s|] inspected, (.*) offence[s|] detected$/
- 0
- elsif line =~ /^warning: .*/
- # don't count internal rubocop errors/warnings
- 0
- else
- 1
- end
+ def self.count_rubocop_violations(line)
+ if line =~ /^.* file[s|] inspected, (.*) offence[s|] detected$/
+ 0
+ elsif line =~ /^warning: .*/
+ # don't count internal rubocop errors/warnings
+ 0
+ else
+ 1
end
end
end
end
end