Class: ThemeCheck::MissingRequiredTemplateFiles
- Inherits:
-
LiquidCheck
- Object
- Check
- LiquidCheck
- ThemeCheck::MissingRequiredTemplateFiles
- Defined in:
- lib/theme_check/checks/missing_required_template_files.rb
Overview
Reports missing shopify required theme files required templates: shopify.dev/tutorials/review-theme-store-requirements-files
Constant Summary collapse
- REQUIRED_LIQUID_FILES =
%w(layout/theme)
- REQUIRED_TEMPLATE_FILES =
%w( index product collection cart blog article page list-collections search 404 gift_card customers/account customers/activate_account customers/addresses customers/login customers/order customers/register customers/reset_password password ) .map { |file| "templates/#{file}" }
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
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_end ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/theme_check/checks/missing_required_template_files.rb', line 19 def on_end (REQUIRED_LIQUID_FILES - theme.liquid.map(&:name)).each do |file| add_offense("'#{file}.liquid' is missing") end (REQUIRED_TEMPLATE_FILES - (theme.liquid + theme.json).map(&:name)).each do |file| add_offense("'#{file}.liquid' or '#{file}.json' is missing") end end |