Class: Reviewer::Doctor::OpportunityCheck

Inherits:
Object
  • Object
show all
Defined in:
lib/reviewer/doctor/opportunity_check.rb

Overview

Suggests improvements based on current configuration and project state

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(report, project_dir, configuration:, tools:) ⇒ OpportunityCheck

Creates an opportunity checker that scans for unconfigured tools and missing features



16
17
18
19
20
21
# File 'lib/reviewer/doctor/opportunity_check.rb', line 16

def initialize(report, project_dir, configuration:, tools:)
  @report = report
  @project_dir = project_dir
  @configuration = configuration
  @tools = tools
end

Instance Attribute Details

#project_dirObject (readonly)

Returns the value of attribute project_dir.



7
8
9
# File 'lib/reviewer/doctor/opportunity_check.rb', line 7

def project_dir
  @project_dir
end

#reportObject (readonly)

Returns the value of attribute report.



7
8
9
# File 'lib/reviewer/doctor/opportunity_check.rb', line 7

def report
  @report
end

Instance Method Details

#checkObject

Checks for unconfigured tools, missing file targeting, and missing format commands



24
25
26
27
28
29
30
# File 'lib/reviewer/doctor/opportunity_check.rb', line 24

def check
  return unless @configuration.file.exist?

  check_unconfigured_tools
  check_missing_files_config
  check_missing_format_command
end