Class: RubocopDirector::Commands::Plan

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop_director/commands/plan.rb

Instance Method Summary collapse

Constructor Details

#initialize(director_config:, rubocop_config:, since: "1995-01-01") ⇒ Plan

Returns a new instance of Plan.



17
18
19
20
21
# File 'lib/rubocop_director/commands/plan.rb', line 17

def initialize(director_config:, rubocop_config:, since: "1995-01-01")
  @since = since.to_s
  @director_config_path = director_config
  @rubocop_config_path = rubocop_config
end

Instance Method Details

#runObject



23
24
25
26
27
28
29
30
# File 'lib/rubocop_director/commands/plan.rb', line 23

def run
  config = yield load_config
  rubocop_json = yield load_rubocop_json
  update_counts = yield load_git_stats
  ranged_files = yield range_files(rubocop_json: rubocop_json, update_counts: update_counts, config: config)

  OutputFormatter.new(ranged_files: ranged_files, since: @since).call
end