Avatar for the UnknownPlatypus user
UnknownPlatypus
djangofmt
BlogDocsChangelog

Performance History

Latest Results

feat(lint): Add `endblock-label` lint rule ## What it does Checks for `{% endblock %}` tags that repeat the block's name on a single-line block, or omit it on a block spanning several lines. ## Why is this bad? On one line, the opening tag is in view and the label is noise. Over several lines, the opening tag may be out of view, and the label tells which block ends. Also applies to `{% endpartialdef %}` and to `custom-blocks` taking one argument. ## Example ```html {% block content %} <h1>{% block title %}Home{% endblock title %}</h1> {% endblock %} ``` Use instead: ```html {% block content %} <h1>{% block title %}Home{% endblock %}</h1> {% endblock content %} ``` ## Options - `custom-blocks` ## References - [Django coding style: template style](https://docs.djangoproject.com/en/stable/internals/contributing/writing-code/coding-style/#template-style) - [Django documentation: template inheritance](https://docs.djangoproject.com/en/stable/ref/templates/language/#template-inheritance) - [Django documentation: template partials](https://docs.djangoproject.com/en/stable/ref/templates/language/#template-partials)
feat/endblock-labels
15 hours ago
fix(deps): update all non-major dependencies
renovate/all-minor-patch
5 days ago
feat(lint): Add `endblock-label` lint rule ## What it does Checks for `{% endblock %}` and `{% endpartialdef %}` tags whose label does not match the layout of their block: missing when the block spans several lines, present when it sits on one. ## Why is this bad? Once the opening tag has scrolled out of view, a bare `{% endblock %}` does not say which block it closes, which makes long and nested blocks hard to follow. On a single line the opening tag is in view, so the label repeats what the reader already sees and only makes the line longer. Django accepts the block's name as a label on the closing tag and checks that it matches, and its template style guide asks for the label exactly when the closing tag is on another line. The blocks listed in `custom-blocks` get the same treatment when their opening tag takes a single argument, as in `{% stage cache %}...{% endstage cache %}`. A label that names another block is left alone: Django rejects the template, and only its author knows which block was meant. The label is decided from the layout at fix time: in a pre-commit hook that runs `check --fix` before the formatter, a block the formatter reflows gets its label fixed on the next run. ## Example ```html {% block content %} <h1>{% block title %}Home{% endblock title %}</h1> {% endblock %} ``` Use instead: ```html {% block content %} <h1>{% block title %}Home{% endblock %}</h1> {% endblock content %} ``` ## Options - `custom-blocks` ## References - [Django coding style: template style](https://docs.djangoproject.com/en/stable/internals/contributing/writing-code/coding-style/#template-style) - [Django documentation: template inheritance](https://docs.djangoproject.com/en/stable/ref/templates/language/#template-inheritance) - [Django documentation: template partials](https://docs.djangoproject.com/en/stable/ref/templates/language/#template-partials)
feat/endblock-labels
5 days ago

Latest Branches

CodSpeed Performance Gauge
-29%
feat(lint): Add `endblock-label` lint rule#569
5 days ago
ce7a0bd
feat/endblock-labels
CodSpeed Performance Gauge
+6%
fix(deps): update all non-major dependencies#583
5 days ago
890c455
renovate/all-minor-patch
CodSpeed Performance Gauge
0%
5 days ago
e54afb7
bump-markup-fmt-trimmed-translation
© 2026 CodSpeed Technology
Home Terms Privacy Docs