lib/quality/runner.rb in quality-27.3.1 vs lib/quality/runner.rb in quality-27.4.0
- old
+ new
@@ -20,17 +20,14 @@
class Runner
TOOL_CLASSES.symbols_and_classes.each { |_symbol, clazz| include clazz }
extend ::Forwardable
- def initialize(config,
- gem_spec: Gem::Specification,
+ def initialize(config, gem_spec: Gem::Specification,
quality_checker_class: Quality::QualityChecker,
- count_io: IO,
- count_file: File,
- globber: Dir,
- which: Which.new)
+ count_io: IO, count_file: File,
+ globber: Dir, which: Which.new)
@config = config
@gem_spec = gem_spec
@quality_checker_class = quality_checker_class
@count_io = count_io
@count_file = count_file
@@ -94,16 +91,21 @@
name = ancestor.to_s.split('::').last.underscore
[name, command_name(ancestor, name)]
end.compact
end
+ def minimum_threshold_for(cmd)
+ @config.minimum_threshold[cmd.to_sym] || 0
+ end
+
def ratchet_quality_cmd(cmd,
command_options,
&count_violations_on_line)
quality_checker = @quality_checker_class.new(cmd,
command_options,
@config.output_dir,
- @config.verbose)
+ @config.verbose,
+ minimum_threshold_for(cmd))
quality_checker.execute(&count_violations_on_line)
end
def_delegators :@config,
:ruby_files,