Class: ThemeCheck::MissingEnableComment
Constant Summary
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
#inherited
#outside_of_strings
Methods inherited from Check
all, can_disable, #can_disable?, category, #category, #code_name, doc, #doc, #ignore!, #ignored?, #severity, severity, #to_s, #unignore!
#format_json_parse_error
Instance Method Details
#after_document(node) ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/theme_check/checks/missing_enable_comment.rb', line 18
def after_document(node)
return if @disabled_checks.full_document_disabled?
return unless @disabled_checks.any?
message = if @disabled_checks.all_disabled?
"All checks were"
else
@disabled_checks.all.join(', ') + " " + (@disabled_checks.all.size == 1 ? "was" : "were")
end
add_offense("#{message} disabled but not re-enabled with theme-check-enable", node: node)
end
|
14
15
16
|
# File 'lib/theme_check/checks/missing_enable_comment.rb', line 14
def (node)
@disabled_checks.update(node)
end
|
#on_document(_node) ⇒ Object
10
11
12
|
# File 'lib/theme_check/checks/missing_enable_comment.rb', line 10
def on_document(_node)
@disabled_checks = DisabledChecks.new
end
|