Sha256: 1cd5b110dbe5d0d556f2cd94fba274dd5b085e76632a4135b5639a7a63678d2e

Contents?: true

Size: 1.59 KB

Versions: 1

Compression:

Stored size: 1.59 KB

Contents

# Ensure consistent spacing inside Liquid tags and variables (`SpaceInsideBraces`)

Warns against inconsistent spacing inside liquid tags and variables.

## Check Details

This check is aimed at eliminating ugly Liquid:

:-1: Examples of **incorrect** code for this check:

```liquid
<!-- Around braces -->
{% assign x = 1%}
{{ x}}
{{x }}

<!-- After commas and semicolons -->
{% form 'type',  object, key:value %}
{% endform %}

<!-- Arround filter pipelines -->
{{ url  | asset_url | img_tag }}
{% assign my_upcase_string = "Hello world"| upcase %}
```

:+1: Examples of **correct** code for this check:

```liquid
{% assign x = 1 %}
{{ x }}
{% form 'type', object, key: value, key2: value %}
{% endform %}
{{ "ignore:stuff,  indeed" }}
{% render 'product-card',
  product_card_product: product_recommendation,
  show_vendor: section.settings.show_vendor,
  media_size: section.settings.product_recommendations_image_ratio,
  center_align_text: section.settings.center_align_text
%}
{{ url | asset_url | img_tag }}
{% assign my_upcase_string = "Hello world" | upcase %}
```

## Check Options

The default configuration for this check is the following:

```yaml
SpaceInsideBraces:
  enabled: true
```

## When Not To Use It

If you don't care about the look of your code.

## Version

This check has been introduced in Theme Check 0.1.0.

## Resources

- [Liquid Style Guide][styleguide]
- [Rule Source][codesource]
- [Documentation Source][docsource]

[styleguide]: https://github.com/Shopify/liquid-style-guide
[codesource]: /lib/theme_check/checks/space_inside_braces.rb
[docsource]: /docs/checks/space_inside_braces.md

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
theme-check-0.8.1 docs/checks/space_inside_braces.md