Shopify / theme-check

The Ultimate Shopify Theme Linter
Other
338 stars 95 forks source link

`schema` tag incorrectly reporting as unclosed whilst using whitespace delimiters #637

Closed ConduciveMammal closed 2 months ago

ConduciveMammal commented 2 years ago

Describe the bug

When using whitespace delimiters on a section's schema tags, theme-check reports it as unclosed. If I remove these, the error message goes away.

With whitespace delimiter CleanShot 2022-09-08 at 3 56 37

Without whitespace delimiter CleanShot 2022-09-08 at 3 57 10

Schema sample:

{%- schema %}
{
  "name": "Blog post header",
  "class": "shopify-section--blog-post-banner",
  "settings": [
    {
      "type": "checkbox",
      "id": "show_category",
      "label": "Show category",
      "info": "The first article's tag will be shown as category.",
      "default": true
    },
    {
      "type": "color",
      "id": "blog_header_background",
      "label": "Background",
      "default": "#f5f5f5"
    },
    {
      "type": "color",
      "id": "blog_header_text_color",
      "label": "Text color",
      "default": "#282828"
    }
  ]
}
{%- endschema -%}

Debugging information

https://github.com/Shopify/theme-check/issues/637#tasklist-block-9355d1cb-bfad-4274-aac3-bb74c013b6ed

charlespwd commented 2 years ago

Upstream Liquid bug, that tag doesn't support whitespace stripping IIRC.

lukeh-shopify commented 2 months ago

👋🏻 Hi @ConduciveMammal! Thanks for reporting this. Unfortunately the Ruby version of theme check has been deprecated for some time. Would you be able to confirm you are still having issues when using our maintained version of theme check? This is done using either the latest version of the Shopify CLI, or via the Shopify Liquid Visual Studio Code extension.

If you are still having issues, please raise an issue over in the CLI or theme tools repositories. Thanks!