This check exists to discourage the use of large template files. Use snippets to componentize your theme.
This check is aimed at eliminating large template files.
👎 Examples of incorrect code for this check:
- Files that have more lines than the threshold
👍 Examples of correct code for this check:
- Files that have less lines than the threshold
The default configuration for this check is the following:
TemplateLength:
enabled: true
max_length: 600
exclude_schema: true
exclude_stylesheet: true
exclude_javascript: true
The max_length
(Default: 200
) option determines the maximum number of lines allowed inside a liquid file.
The exclude_schema
(Default: true
) option determines if the lines inside {% schema %}
blocks from a template should be excluded from the line count.
The exclude_stylesheet
(Default: true
) option determines if the lines inside {% stylesheet %}
blocks from a template should be excluded from the line count.
The exclude_javascript
(Default: true
) option determines if the lines inside {% javascript %}
blocks from a template should be excluded from the line count.
If you don't care about template lengths, then it's safe to disable this rule.
This check has been introduced in Theme Check 0.1.0.