You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to write a jinja2 template for networking equipment (arista switches, more or less cisco CLI) using vscode.
I installed the dlint extension and enabled "preserve leading spaces".
Leading spaces on my switch config code are preserved.
However, comments that would need an indent (inside a if-clause) get intended over and over on every file save (as vscode formats on save).
Also jinja2 set commands will not get indented at all and will be put to the start of the line.
How To Reproduce
{% if condition %}
{# aaa #}
{%- set varx = "aaa" %}
aaa
{% endif %}
run djlint <filename> --preserve-leading-space --reformat on the snippet once.
results in:
{% if condition %}
{# aaa #}
{%- set varx = "aaa" %}
aaa
{% endif %}
run it a few times and you get
{% if condition %}
{# aaa #}
{%- set varx = "aaa" %}
aaa
{% endif %}
The text was updated successfully, but these errors were encountered:
System Info
Issue
I am trying to write a jinja2 template for networking equipment (arista switches, more or less cisco CLI) using vscode.
I installed the dlint extension and enabled "preserve leading spaces".
Leading spaces on my switch config code are preserved.
However, comments that would need an indent (inside a if-clause) get intended over and over on every file save (as vscode formats on save).
Also jinja2 set commands will not get indented at all and will be put to the start of the line.
How To Reproduce
run
djlint <filename> --preserve-leading-space --reformat
on the snippet once.results in:
run it a few times and you get
The text was updated successfully, but these errors were encountered: