Skip to main content

MissingRenderSnippetArguments

All required arguments defined in a snippet file's LiquidDoc must be provided when rendering that snippet.


The following examples contain code snippets that either pass or fail this check. Each example references this base snippet, which defines two parameters: one required and one optional (identified by square brackets).

snippets/example-snippet.liquid

{% doc %}
@param {string} some_str
@param {number} [some_num]
{% enddoc %}

In the following example, the snippet is being rendered without the required argument:

sections/section.liquid

{% render 'example-snippet', some_num: 1 %}

In the following example, the required argument is being provided, but the optional argument is not:

sections/section.liquid

{% render 'example-snippet', some_str: 'text' %}

In the following example, the required argument and the optional argument is being provided:

sections/section.liquid

{% render 'example-snippet', some_str: 'text', some_num: 1 %}

The following example contains the default configuration for this check:

MissingRenderSnippetArguments:
enabled: true
severity: warning
ParameterDescription
enabledWhether this check is enabled.
severityThe severity of the check.

Anchor to Disabling this checkDisabling this check

Disabling this check isn't recommended.


Was this page helpful?