Skip to content

Jinja blocks should be indented #317

Closed Answered by alrocar
tconbeer asked this question in The sqlfmt Style
Discussion options

You must be logged in to vote

But for crazy all-jinja models/macros, you lose a lot by not having any indentation. (e.g., the incremental materialization).

💯

I personally find it more natural everything indented à la python (and have received feedback in that sense as well)

I would expect the block in the top comment to be indented like this:

{% set cols = ['a', 'b', 'c'] %}
select
    {% for col in cols %}
        nullif({{ col }}, "") as {{ col }}
    {% endfor %}
from tbl

Would that make sense to you?

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by tconbeer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 participants