Class: PlatformosCheck::ValidYaml

Inherits:
YamlCheck show all
Defined in:
lib/platformos_check/checks/valid_yaml.rb

Constant Summary

Constants inherited from Check

Check::CATEGORIES, Check::SEVERITIES, Check::SEVERITY_VALUES

Instance Attribute Summary

Attributes inherited from Check

#ignored_patterns, #offenses, #options, #platformos_app

Instance Method Summary collapse

Methods inherited from YamlCheck

#add_offense

Methods included from ChecksTracking

#inherited

Methods inherited from Check

#==, #add_offense, all, can_disable, #can_disable?, categories, #categories, category, #code_name, doc, #doc, docs_url, #ignore!, #ignored?, #severity, severity, #severity=, #severity_value, severity_value, single_file, #single_file?, #to_s, #whole_platformos_app?

Methods included from JsonHelpers

#format_json_parse_error, #pretty_json

Instance Method Details

#on_file(file) ⇒ Object



9
10
11
12
13
14
# File 'lib/platformos_check/checks/valid_yaml.rb', line 9

def on_file(file)
  return unless file.parse_error

  message = file.parse_error
  add_offense(message, app_file: file)
end