Sha256: f864a871b528278f6f5a82beb7baffb0243673f4aed1bcdc9009d5813d5d8941

Contents?: true

Size: 1.52 KB

Versions: 23

Compression:

Stored size: 1.52 KB

Contents

# Prevent missing templates (`MissingTemplate`)

This check exists to prevent rendering resources with the `render` tag, `function` tag (and the deprecated `include` tag) that do not exist.

## Check Details

This check is aimed at preventing liquid rendering errors.

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

```liquid
{% render 'partial-that-does-not-exist' %}
```

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

```liquid
{% render 'partial-that-exists' %}
```

## Check Options

The default configuration for this check is the following:

```yaml
MissingTemplate:
  enabled: true
  ignore_missing: []
```

### `ignore_missing`

Specify a list of patterns of missing template files to ignore.

While the `ignore` option will ignore all occurrences of `MissingTemplate` according to the file in which they appear, `ignore_missing` allows ignoring all occurrences of `MissingTemplate` based on the target template, the template being rendered.

For example:

```yaml
MissingTemplate:
  ignore_missing:
  - icon-*
```

Would ignore offenses on `{% render 'icon-missing' %}` across app files.

```yaml
MissingTemplate:
  ignore:
  - modules/private-module/index.liquid
```

Would ignore all `MissingTemplate` in `modules/private-module/index.liquid`, no mater the file being rendered.

## Version

This check has been introduced in PlatformOS Check 0.0.1.

## Resources

- [Rule Source][codesource]
- [Documentation Source][docsource]

[codesource]: /lib/platformos_check/checks/missing_template.rb
[docsource]: /docs/checks/missing_template.md

Version data entries

23 entries across 23 versions & 1 rubygems

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