Class: ThemeCheck::SyntaxError

Inherits:
LiquidCheck show all
Defined in:
lib/theme_check/checks/syntax_error.rb

Overview

Report Liquid syntax errors

Constant Summary

Constants inherited from LiquidCheck

LiquidCheck::ATTR, LiquidCheck::HTML_ATTRIBUTE, LiquidCheck::HTML_ATTRIBUTES, LiquidCheck::QUOTED_LIQUID_ATTRIBUTE, LiquidCheck::START_OR_END_QUOTE, LiquidCheck::TAG, LiquidCheck::VARIABLE

Constants inherited from Check

Check::CATEGORIES, Check::SEVERITIES

Instance Attribute Summary

Attributes inherited from Check

#offenses, #options, #theme

Instance Method Summary collapse

Methods inherited from LiquidCheck

#add_offense

Methods included from ChecksTracking

#inherited

Methods included from ParsingHelpers

#outside_of_strings

Methods inherited from Check

all, can_disable, #can_disable?, categories, #categories, category, #code_name, #doc, doc, docs_url, #ignore!, #ignored?, #severity, severity, #to_s, #unignore!

Methods included from JsonHelpers

#format_json_parse_error

Instance Method Details

#on_document(node) ⇒ Object



9
10
11
12
13
# File 'lib/theme_check/checks/syntax_error.rb', line 9

def on_document(node)
  node.template.warnings.each do |warning|
    add_exception_as_offense(warning, template: node.template)
  end
end

#on_error(exception) ⇒ Object



15
16
17
# File 'lib/theme_check/checks/syntax_error.rb', line 15

def on_error(exception)
  add_exception_as_offense(exception, template: theme[exception.template_name])
end