Class: ThemeCheck::MissingEnableComment
- Inherits:
-
LiquidCheck
- Object
- Check
- LiquidCheck
- ThemeCheck::MissingEnableComment
- Defined in:
- lib/theme_check/checks/missing_enable_comment.rb
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
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
#after_document(node) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/theme_check/checks/missing_enable_comment.rb', line 19 def after_document(node) return if @disabled_checks.full_document_disabled? return unless @disabled_checks.any? = if @disabled_checks.all_disabled? "All checks were" else @disabled_checks.all.join(', ') + " " + (@disabled_checks.all.size == 1 ? "was" : "were") end add_offense("#{} disabled but not re-enabled with theme-check-enable", node: node) end |
#on_comment(node) ⇒ Object
15 16 17 |
# File 'lib/theme_check/checks/missing_enable_comment.rb', line 15 def on_comment(node) @disabled_checks.update(node) end |
#on_document(_node) ⇒ Object
11 12 13 |
# File 'lib/theme_check/checks/missing_enable_comment.rb', line 11 def on_document(_node) @disabled_checks = DisabledChecks.new end |