Skip to content

Jinja Rules

This section contains 1 rule(s) related to jinja.

Rule Summary

CodeNameAliasesFix Compatible
JJ01jinja.paddingL046

JJ01: jinja.padding

Jinja tags should have a single whitespace on either side.

PropertyValue
Namejinja.padding
AliasesL046
Groupsall, core, jinja
Auto-fixableYes ✅

This rule is only active if the jinja templater (or one of it's subclasses, like the dbt templater) are used for the current file.

Anti-pattern

Jinja tags with either no whitespace or very long whitespace are hard to read.

jinja
SELECT {{    a     }} from {{ref('foo')}}

Best practice

A single whitespace surrounding Jinja tags, alternatively longer gaps containing newlines are acceptable.

jinja
SELECT {{ a }} from {{ ref('foo') }};
SELECT {{ a }} from {{
    ref('foo')
}};

Released under the MIT License.