Sha256: aa94bfe2bc5a317a6d51bcf574a364b076e5943618789b89ca316dfcb8933e2f

Contents?: true

Size: 1.33 KB

Versions: 23

Compression:

Stored size: 1.33 KB

Contents

# Discourage the use of `include` (`ConvertIncludeToRender`)

The `include` tag is [deprecated][deprecated]. This tag exists to enforce the use of the `render` tag instead of `include`.

The `include` tag works similarly to the `render` tag, but it lets the code inside of the snippet to access and overwrite the variables within its parent theme file. The `include` tag has been deprecated because the way that it handles variables reduces performance and makes theme code harder to both read and maintain.

## Check Details

This check is aimed at eliminating the use of `include` tags.

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

```liquid
{% include 'snippet' %}
```

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

```liquid
{% render 'snippet' %}
```

## Check Options

The default configuration for this check is the following:

```yaml
ConvertIncludeToRender:
  enabled: true
```

## When Not To Use It

It is discouraged to disable this rule.

## Version

This check has been introduced in PlatformOS Check 0.0.1.

## Resources

- [Deprecated Tags Reference][deprecated]
- [Rule Source][codesource]
- [Documentation Source][docsource]

[deprecated]: https://documentation.platformos.com/api-reference/liquid/include
[codesource]: /lib/platformos_check/checks/convert_include_to_render.rb
[docsource]: /docs/checks/convert_include_to_render.md

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
platformos-check-0.4.12 docs/checks/convert_include_to_render.md
platformos-check-0.4.11 docs/checks/convert_include_to_render.md
platformos-check-0.4.10 docs/checks/convert_include_to_render.md
platformos-check-0.4.9 docs/checks/convert_include_to_render.md
platformos-check-0.4.8 docs/checks/convert_include_to_render.md
platformos-check-0.4.7 docs/checks/convert_include_to_render.md
platformos-check-0.4.6 docs/checks/convert_include_to_render.md
platformos-check-0.4.5 docs/checks/convert_include_to_render.md
platformos-check-0.4.4 docs/checks/convert_include_to_render.md
platformos-check-0.4.3 docs/checks/convert_include_to_render.md
platformos-check-0.4.2 docs/checks/convert_include_to_render.md
platformos-check-0.4.1 docs/checks/convert_include_to_render.md
platformos-check-0.4.0 docs/checks/convert_include_to_render.md
platformos-check-0.3.3 docs/checks/convert_include_to_render.md
platformos-check-0.3.1 docs/checks/convert_include_to_render.md
platformos-check-0.3.0 docs/checks/convert_include_to_render.md
platformos-check-0.2.2 docs/checks/convert_include_to_render.md
platformos-check-0.2.1 docs/checks/convert_include_to_render.md
platformos-check-0.2.0 docs/checks/convert_include_to_render.md
platformos-check-0.1.0 docs/checks/convert_include_to_render.md