Describe the bug
When a quoted string including a space is included within the opening line of a forloop, theme-check incorrectly reports is as invalid syntax.
Source
{%- for value in product.options_by_name['hello world'].values -%}
{{ value }}
{%- endfor -%}
Expected behaviour
The syntax is fine - there are no issues using this syntax in a theme, so there should be no reported theme-check errors.
Actual behaviour
A syntax error is reported after the space in the quoted string.
Also when theme-check tries to autofix the error on save, it actually creates broken syntax.
The snippet described earlier gets "corrected" to
{%- for value in product.options_by_name['hello -%}
{{ value }}
{%- endfor -%}
I suspect simply not flagging the error to begin would prevent this.
Debugging information
- OS [e.g. Windows, Mac, Linux]: Mac
- OS Version: Tahoe 26.3.1 (a)
- Theme Check Version [e.g. 0.1.0]: 3.94.1 (shopify-cli, I'm not sure if theme check has a different version or where I'd find it)
Describe the bug
When a quoted string including a space is included within the opening line of a forloop, theme-check incorrectly reports is as invalid syntax.
Source
{%- for value in product.options_by_name['hello world'].values -%} {{ value }} {%- endfor -%}Expected behaviour
The syntax is fine - there are no issues using this syntax in a theme, so there should be no reported theme-check errors.
Actual behaviour
A syntax error is reported after the space in the quoted string.
Also when theme-check tries to autofix the error on save, it actually creates broken syntax.
The snippet described earlier gets "corrected" to
{%- for value in product.options_by_name['hello -%} {{ value }} {%- endfor -%}I suspect simply not flagging the error to begin would prevent this.
Debugging information