Class: Reviewer::Doctor::KeywordCheck

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

Overview

Detects conflicts between configured tool names, tags, and reserved keywords

Constant Summary collapse

RESERVED =
Arguments::Keywords::RESERVED

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(report, configuration:, tools:) ⇒ KeywordCheck

Creates a keyword check that scans for keyword conflicts in configuration

Parameters:

  • report (Doctor::Report)

    the report to add findings to

  • configuration (Configuration)

    the configuration to check

  • tools (Tools)

    the tools collection to analyze



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

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

Instance Attribute Details

#reportObject (readonly)

Returns the value of attribute report.



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

def report
  @report
end

Instance Method Details

#checkObject

Checks for keyword conflicts between tool names, tags, and reserved keywords



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

def check
  return unless @configuration.file.exist?

  check_tool_names_vs_reserved
  check_tags_vs_reserved
  check_tool_names_vs_tags
rescue Configuration::Loader::MissingConfigurationError
  # Tools may reference a stale config path — nothing to check
end