Class: ThemeCheck::MissingTemplate
- Inherits:
-
LiquidCheck
- Object
- Check
- LiquidCheck
- ThemeCheck::MissingTemplate
- Defined in:
- lib/theme_check/checks/missing_template.rb
Overview
Reports missing include/render/section template
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
Instance Method Summary collapse
- #on_include(node) ⇒ Object (also: #on_render)
- #on_section(node) ⇒ Object
Methods inherited from LiquidCheck
Methods included from ChecksTracking
Methods included from ParsingHelpers
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
Instance Method Details
#on_include(node) ⇒ Object Also known as: on_render
9 10 11 12 13 14 15 16 |
# File 'lib/theme_check/checks/missing_template.rb', line 9 def on_include(node) template = node.value.template_name_expr if template.is_a?(String) unless theme["snippets/#{template}"] add_offense("'snippets/#{template}.liquid' is not found", node: node) end end end |
#on_section(node) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/theme_check/checks/missing_template.rb', line 19 def on_section(node) template = node.value.section_name unless theme["sections/#{template}"] add_offense("'sections/#{template}.liquid' is not found", node: node) end end |