Skip to content

Allow indentation inside template tags #6

Open
@robertpro

Description

@robertpro

Is your proposal related to a problem?

Yes

Describe the solution you’d like

I would like to indent inside template tags

Describe alternatives you’ve considered

setting curlylint --rule 'indent: 4'

Additional context

Given this code:

{% extends 'home/base.html' %}

{% load cache%}

{% block body %}
    {% cache 6000 home.home %}
        {{ block.super }}
        <p>Last request: {{ date }}</p>
    {% endcache %}
{% endblock %}

I get these errors:

curlylint --rule 'indent: 4' apps/home/templates/home/home.html
apps/home/templates/home/home.html
6:8     Bad indentation, expected 4, got 8      indent
7:8     Bad indentation, expected 4, got 8      indent

Oh no! 💥 💔 💥
2 errors reported

Which I can fix like this:

{% extends 'home/base.html' %}

{% load cache%}

{% block body %}
    {% cache 6000 home.home %}
    {{ block.super }}
    <p>Last request: {{ date }}</p>
    {% endcache %}
{% endblock %}

Result:

curlylint --rule 'indent: 4' apps/home/templates/home/home.html
All done! ✨ 🍰 ✨

Can we add this feature?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is neededparserThis issue relates to Curlylint’s templates parser

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions