Class: PropertyGenerator::Linter

Inherits:
Object
  • Object
show all
Defined in:
lib/linter/linter.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Linter

Returns a new instance of Linter.



8
9
10
11
12
13
14
15
# File 'lib/linter/linter.rb', line 8

def initialize(path)
  ignore_list = ['README.md']
  invalid_paths = PropertyGenerator.invalid_paths(path, ignore_list)
  @config_linter = PropertyGenerator::ConfigLinter.new(path+"/config/config.yml")
  @globals_linter = PropertyGenerator::GlobalsLinter.new(path+"/globals/", @config_linter.configs)
  @services_linter = PropertyGenerator::ServicesLinter.new(path+"/services/", @config_linter.configs)
  @report = PropertyGenerator::Report.new(invalid_paths)
end

Instance Method Details

#display_reportObject



34
35
36
# File 'lib/linter/linter.rb', line 34

def display_report
  @report.display_report
end

#fail_checkObject



26
27
28
29
30
31
32
# File 'lib/linter/linter.rb', line 26

def fail_check
  if @report.has_a_test_failed || @report.has_a_file_failed_to_load
    true
  else
    false
  end
end

#run_testsObject



17
18
19
20
21
22
23
24
# File 'lib/linter/linter.rb', line 17

def run_tests
  config_report = @config_linter.run_config_tests
  globals_report = @globals_linter.run_globals_tests
  service_linter = @services_linter.run_services_tests
  @report.add_report(config_report)
  @report.add_report(globals_report)
  @report.add_report(service_linter)
end