djLint
djLint copied to clipboard
[FEATURE] Auto fix T002, T003, but potentially any auto-fixable issue
Feature Request
Perhaps similar to https://github.com/Riverside-Healthcare/djLint/issues/252, so I'm linking it for cross-reference.
I was wondering if there's a way to enable auto fixing of certain problems like for example the two mentioned below?
It does work for some problems (like adding spaces inside a variable), but it'd be really nice if it could work with these too.
Example
Given this code:
{% block name %}
{% include 'header.twig' %}
{% endblock %}
These problems are reported, based on my .djlintrc config:
-
Endblock should have name. Ex: {% endblock body %}. {% endblock %} (T003)
-
Double quotes should be used in tags. {% include 'header.t (T002)
And ideally the code above should be replaced with the following on save:
{% block name %}
{% include "header.twig" %}
^ ^
{% endblock name %}
^^^^
Thank you :)
This is what I would expect for an automatic formatter. black
for example, fixed the quotes of a file automatically.