Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [Linter] Cache is not among default block tags #823

Open
3 tasks done
PetrDlouhy opened this issue Mar 29, 2024 · 0 comments
Open
3 tasks done

[BUG] [Linter] Cache is not among default block tags #823

PetrDlouhy opened this issue Mar 29, 2024 · 0 comments
Labels
🔍 linter 🦠 bug Something isn't working

Comments

@PetrDlouhy
Copy link

System Info

  • OS: e.g. ubuntu 23.10
  • Python Version: Python 3.11.6
  • djLint Version: djlint, version 1.34.1
  • profile: django

Issue

djlint is not treating cache as block tag:

<body>
    {% block top_navbar %}
        {% cache 600 %}
        {% endcache %}
    {% endblock top_navbar %}
</body>

Would be reformated by djlint blenderhub/templates/base.html --reformat --profile=django to:

<body>
    {% block top_navbar %}
        {% cache 600 %}
    {% endcache %}
{% endblock top_navbar %}
</body>

The {% cache %} is official Django block tag: https://docs.djangoproject.com/en/5.0/topics/cache/

How To Reproduce

See above. With settings custom_blocks="cache" the reformat works as expected.j

Contents of .djlintrc/pyproject.toml [tool.djlint]

[tool.djlint]
profile="django"
# custom_blocks="cache"
@PetrDlouhy PetrDlouhy added 🔍 linter 🦠 bug Something isn't working labels Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔍 linter 🦠 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant