lib/quality/runner.rb in quality-14.1.0 vs lib/quality/runner.rb in quality-15.0.0
- old
+ new
@@ -1,27 +1,30 @@
+require 'active_support/inflector'
require 'forwardable'
require_relative 'tools/cane'
require_relative 'tools/flay'
require_relative 'tools/flog'
require_relative 'tools/reek'
require_relative 'tools/rubocop'
require_relative 'tools/bigfiles'
require_relative 'tools/punchlist'
require_relative 'tools/brakeman'
+require_relative 'tools/rails_best_practices'
module Quality
# Knows how to run different quality tools based on a configuration
# already determined.
class Runner
include Tools::Cane
include Tools::Flay
include Tools::Flog
include Tools::Reek
include Tools::Rubocop
- include Tools::BigFiles
+ include Tools::Bigfiles
include Tools::Punchlist
include Tools::Brakeman
+ include Tools::RailsBestPractices
extend ::Forwardable
def initialize(config,
gem_spec: Gem::Specification,
@@ -51,13 +54,11 @@
puts "#{tool} not installed"
end
end
def run_ratchet
- @config.all_output_files.each do |filename|
- run_ratchet_on_file(filename)
- end
+ @config.all_output_files.each { |filename| run_ratchet_on_file(filename) }
end
def run_ratchet_on_file(filename)
puts "Processing #{filename}"
existing_violations = count_existing_violations(filename)
@@ -79,10 +80,10 @@
def tools
self.class.ancestors.map do |ancestor|
ancestor_name = ancestor.to_s
next unless ancestor_name.start_with?('Quality::Tools::')
- ancestor_name.split('::').last.downcase
+ ancestor_name.split('::').last.underscore
end.compact
end
def ratchet_quality_cmd(cmd,
command_options,