Jinja Rules
This section contains 1 rule(s) related to jinja.
Rule Summary
| Code | Name | Aliases | Fix Compatible |
|---|---|---|---|
| JJ01 | jinja.padding | L046 | ✅ |
JJ01: jinja.padding
Jinja tags should have a single whitespace on either side.
| Property | Value |
|---|---|
| Name | jinja.padding |
| Aliases | L046 |
| Groups | all, core, jinja |
| Auto-fixable | Yes ✅ |
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')
}};