chore(deps): update dependency djlint to >=1.44.0 #621
No reviewers
Labels
No labels
API
Billing
UI/UX
dependencies
bug
change
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
servala/servala-portal!621
Loading…
Reference in a new issue
No description provided.
Delete branch "renovate/djlint-1.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
>=1.40.6→>=1.44.0Release Notes
djlint/djLint (djlint)
v1.44.0Compare Source
Feature
--allow-empty-inputoption, and the matchingallow_empty_inputconfig key, exits0instead of2when the given paths match no files.Fix
{% if %}...{% endif %}no longer dedents everything that follows it by one level, collapsing nested structures toward column 0 - a regression in 1.43.0. A close tag already at the content level of the template block it sits in is held there, but the level it was denied was then taken off the end of the line instead, so{% if r %}</strong>{% endif %}moved the rest of the block left. The matching open tag never took a level to give back, since{% endif %}had already returned it.exclude,extend_exclude,use_gitignoreorrequire_pragmanow exits0instead of1. Skipping them is the configuration doing its job, and it is what letsexcludework under pre-commit, which passes the names of every staged file. Paths that match no files at all now exit2rather than1, so exit1means only that djLint found something to report.2instead of1, so a crash is no longer indistinguishable from a lint error. The traceback is still printed.--profile, orprofilein a config file, is now a usage error. A typo used to lint with a silently different rule set and exit0, and raisedKeyErrorwith--require-pragma.build.html/) is no longer picked up as a template and opened as a file, crashing the run.No files to check!is written to stderr instead of stdout, where formatted code is written.djlint - --reformatthat--require-pragmaskips is handed back byte for byte instead of being replaced byNo files to check!.v1.43.2Compare Source
Fix
blank_line_before_tagno longer inserts a blank line when the previous line opens a block and increases the indentation, e.g. between<div>and{% block %}. Since 1.41.0blank_line_after_taghas left the closing edge of a block alone ({% endblock %}before</div>), while the opening edge kept its padding, so a template using both options came out lopsided.v1.43.1Compare Source
Fix
H025no longer reports the closing tag of a multi-line<script>or<style>as an orphan - a regression in 1.43.0. A genuinely unmatched</script>is still reported.v1.43.0Compare Source
Feature
--stdin-filenameoption gives content piped in on stdin (djlint -) its real path, soper-file-ignoresmatches against that name and linter messages report it. Per-file ignores were previously dead for piped input, since nothing matches the name-. Path separators are normalized as they are for files on disk.Fix
title="{% translate "You don't have permission" %}") no longer swallows the rest of the document, which madeH025report every enclosing element as an orphan. A template tag in a value is now skipped whole unless it holds a>, so a quoted literal likea="{{"is still left alone.</span>tail<textarea>y</textarea>) unindents again; everything after it stayed one level too deep.{% endif %} <td class="x">y</td>) indents as a block tag again, so{% endif %}unindents and{% else %}aligns with its{% if %}. A line only takes that shape once the tag fits on one line, so reformatting an already formatted file moved it.</pre> <span>x) is tracked again; its closing tag took a level from a tag opened before the block, dedenting that tag's siblings.<div>{% if x %}), and the choice is no longer applied to the wrong block. Blocks were paired with the source by position, which does not line up with the expanded html; they are now matched by tag and contents.style,srcset,data-srcsetorsizesvalue was written over several lines is no longer spread over multiple lines and pulled back together on the next run.max_attribute_lengthis now measured against what is written out, not against padding that the rewrite drops.<pre>or<textarea>opened on a line that also holds a self-contained comment (<pre>x<!--c-->) is recognized as opening a verbatim block again. Its contents were re-indented instead of left alone, and the closing</pre>gained an indent level on every run - unbounded whitespace growth inside preformatted text.text <b>bold/</b> tail). The loss accumulated, so a document repeating that shape drifted further left with each occurrence. A closing tag with nothing to pair against still dedents as before.<inside a one-line<script>,<style>,<textarea>or<title>no longer counts as a tag when indenting.<script>var a = '<span>'</script>left a phantom open<span>on the tag stack, leaving everything after it one level too deep.text <b>bold/more</b> tailinside a<p>) - a regression in 1.40.8. The wrong output was idempotent, so it survived later runs.{{/* ... */}}is no longer read as a block close tag. It starts with{{/, the handlebars block-close prefix, so it popped a block off the stack:H037reportedDuplicate attribute found.for mutually exclusive attributes such as<a {{if .A}}href="a"{{else}}{{/* c */}}href="b"{{end}}>, and the formatter unindented the rest of the block. A comment renders as nothing, soH037no longer treats one as a template-generated attribute name prefix either.{% if x %}{# comment #}- was skipped by the linter, most visibly makingT038reportEnd tag has no matching block tagfor a balanced{% if %}. Affects every rule that skips ignored blocks (H025,H037,H041,H042,T002,T003,T027,T038,T039) and every kind of ignored block.djlint:offpragma no longer ignores the tag written immediately before it.<img>{# djlint:off #}silently dropped every error on that<img>, while<img>{# djlint:off H013 #}correctly reported it - a pragma covers what follows it, not what precedes it.v1.42.3Compare Source
Fix
-,.,:,@and*no longer stop a tag from being wrapped over multiple lines. The attribute parser now accepts any character HTML allows in an attribute name, so Alpine key modifiers (@keydown.prevent.?), Angular bindings ((click),[disabled]) and Vue shorthands (#slot) are formatted like every other attribute instead of leaving the whole tag on one long line. Angular bindings also reach--format-attribute-js-jsonfor the first time, which already listed them.src={{ MEDIA_URL }}/logo.png,href={{ .Permalink }}#{{ .Anchor }}) is no longer split into a truncated value plus a bogus standalone attribute when attributes are wrapped; it stays one value, quoted when spread.v1.42.2Compare Source
Fix
${...}inside a quoted value (e.g. JS template literals like:name="`x[${i}]`") respectmax_attribute_lengthagain and are spread over multiple lines - a regression in 1.40.6. Unquoted Mako-style${...}expressions in tags are still left unformatted.<!--that is not a real HTML comment (for example inside a{# ... #}template comment or inside a<textarea>/<pre>) no longer swallows the rest of the document. This fixes falseH025orphan-tag reports and over-indentation of the tags that follow - a regression in 1.40.6.{{{ ... }}}and raw-block{{{{ ... }}}}expressions used as tag attributes are tokenized correctly again, fixing falseH025orphan-tag reports - a regression in 1.40.6.data-x="{{") no longer makes the tokenizer scan into later content looking for a matching}}, which could collapse<pre>/<textarea>whitespace - a regression in 1.40.6.}}of a handlebars{{#if}}/{{#each}}block-open tag is now idempotent; it no longer leaks a trailing space into the following{{...}}tag on later formatting passes.T038no longer reports block tags that appear only inside a handlebars comment ({{!-- ... --}},{{! ... }}) or inside a handlebars raw block ({{{{raw}}}} ... {{{{/raw}}}}).T039no longer reports handlebars raw-block delimiters ({{{{raw}}}}/{{{{/raw}}}}) as unclosed template tags.<or dangling=) are now left untouched instead of having the unparsable characters silently dropped when attributes are wrapped.<used as a less-than operator inside a template expression in text or<script>content (e.g.${a<b},{{a<b}}) is no longer mistaken for an HTML tag start, which could merge or drop following content and break idempotency - a regression in 1.40.6.:or/(e.g.href=https://example.com/page) are no longer split into a truncated value plus a bogus standalone attribute when attributes are wrapped - a regression in 1.40.6.="value"attribute is no longer rewritten with the literal attribute nameNone; malformed attributes are left untouched.<textarea>/<pre>is preserved instead of being collapsed by whitespace cleanup (it is verbatim content).Performance
{% comment %},{% blocktrans %},{% filter %},<pre>,<script>, etc.) is dramatically faster on templates with many{% ... %}tags. A lazy[ ]*?before the block keywords caused pathological backtracking; the equivalent greedy[ ]*removes it, cutting reformat time on large template-heavy files by roughly 5x.v1.42.1Compare Source
Fix
command,keygenandmenuitem- elements that were removed from the HTML standard.Changed
Linter rule defaults were reviewed against a simple bar: on by default means correctness, security, clear accessibility, or a consistency check the formatter also enforces - with near-zero false positives. Four rules moved to opt-in (
--include=...):{% endblock %}; the name demand is a style preference. The correctness checks T003 used to bundle - unclosed{% block %}, orphan{% endblock %}and mismatched endblock names, all hard template errors - moved into T038, which stays on by default, so nothing real is lost when T003 is off.aspect-ratio, preventing layout shift) but performance rather than correctness, and the dimensions are frequently unknowable in a template - user uploads, CMS urls, art-directed<picture>sources - so the rule demands data the author may not have.--include=H031.{{ ... }}output (form widgets),{% include %}/{% extends %}or unrecognized template tag silences the rule for that file, so where it does run, every report is a genuinely broken label association (a WCAG 1.3.1/4.1.2 failure the W3C validator also treats as an error).v1.42.0Compare Source
Feature
Template languages:
askamaprofile for Askama (jinja-style templates in Rust). Rust expressions are never reformatted: function and{% set %}/{% let %}formatting are disabled sosome_macro!("foo")?, char literals'a'and tuples keep their exact spelling, and string quotes are never rewritten. The Flask-specificurl_forrules (J004/J018) don't apply.teraprofile for Tera (Rust, used by Zola): jinja-style formatting plus Tera v2{% component %}/{% endcomponent %}blocks and single-tag{% set_global %}. The Flask-specificurl_forrules don't apply. MiniJinja needs no profile of its own - it is fully Jinja2-compatible, use--profile=jinja.liquidprofile for Liquid (Shopify themes, Jekyll, Eleventy, the Rustliquidcrate).{% case %}/{% when %},{% capture %},{% tablerow %},{% form %},{% paginate %},{% highlight %}and{% unless %}/{% elsif %}indent correctly,{%- -%}whitespace control is handled, and the bodies of Shopify section tags ({% schema %},{% style %},{% javascript %},{% stylesheet %}) are left untouched - they contain JSON, CSS or JS rather than html.golangprofile now indents template blocks:{{ if }},{{ range }},{{ with }},{{ block }}and{{ define }}indent their contents up to the matching{{ end }}, with{{ else }}/{{ else if }}as branches and the{{- -}}whitespace-control forms included. Blocks opened and closed on one line are left alone; single tags like{{ template }}and lookalike variables such as{{ .end }}are unaffected.New linter rules:
{% extends %}or{% include %}with a missing or empty template name - an error the engine only raises at render time, so the typo is easy to ship.{% block %}and closed in a different one. The pair looks balanced in the file, but a child template overriding either block renders unbalanced html.--include=H018): void tags closed with/>instead of>, e.g.<br/>- the trailing slash has no effect in HTML. The opposite convention of the optional H017 ("void tags should be self closing"); enable one or the other, not both.--include=H042): a<label for="...">whose value matches no elementidin the same file. Template-generated values are skipped; the rule is opt-in because inputs rendered by e.g.{{ form.email }}carry ids the linter cannot see.Configuration:
indentandmax_line_lengthnow fall back toindent_sizeandmax_line_lengthfrom a.editorconfigat the project root. The command line and djlint config files still take precedence, and only sections applying to html (or the configuredextension) are read.Documentation:
Fix
<cola>(matched by a brokencolgroupexclusion) and custom elements like<img-icon>are no longer reported.<meta>tags, missing from the rule's void tag list, are now reported.v1.41.0Compare Source
Feature
{% if %}without{% endif %}, handlebars{{#if}}without{{/if}}, end tags with no opening tag, and crossed blocks like{% if %}{% for %}{% endif %}. Tags fromcustom_blocksare checked too;{% block %}/{% endblock %}pairs stay covered by T003.{% url 'x" user.url }}(closed by}}instead of%}),{{ user.name }(missing a brace), or a tag cut off by the next tag or the end of the file. Complements T027 (unclosed string in a complete tag) and T034 (}%typo), which keep reporting their own cases.--rules FILECLI option: load a custom rules file in.djlint_rules.yamlformat from any path, instead of only next topyproject.toml.Changed
{% if abc == 101 %}becomes{% if abc == 101 %}. This fixes what rule T032 reports, so the linter and formatter no longer conflict. Whitespace inside string literals is preserved, including strings with backslash-escaped quotes; multiline tags, ignored blocks, the literal contents of{% verbatim %}/{% raw %}and the handlebars/golang profiles are untouched.excludelist is now tailored to djLint instead of copying ruff/black. Added directories that hold generated or third-party HTML:htmlcov(coverage.py reports),site-packages(installed packages' templates such as Django admin and DRF, matched in any virtualenv layout) and_site(Jekyll/Eleventy output). Removed Python tool caches and editor config that never contain HTML:.ipynb_checkpoints,.mypy_cache,.pytest_cache,.pytype,.ruff_cache,.pants.d,.vscodeandbuck-out.Fix
Formatter indentation:
<div>rendered by{% if %}...{% endif %}and closed by a later conditional) no longer shift the indentation of everything after it. When every branch of an{% if %}/{% elif %}/{% else %}shifts the depth equally, e.g. a<tr>opened in both branches, the shift is kept after{% endif %}.{% story ... with { ... } %},{% include ... with { ... } %}and non-JSON{{ func(...) }}calls are now indented by bracket depth.{% endtrans %}(Jinja/Twig block{% trans %}) no longer decreases the indentation level, which shifted the{% endtrans %}line and everything after it one level to the left.{% set %}objects nested inside HTML elements are no longer over-indented in proportion to their nesting depth.{% component "calendar" date="2015-06-19" / %}withcustom_blocks = "component") no longer indent the lines that follow them as if a block had been opened.Formatter line breaks and spacing:
{% set x %}...{% endset %}is no longer expanded onto multiple lines. The block captures its content verbatim, so the added whitespace changed the value of the variable. Authored multi-line set blocks are still indented as before.{{ ... }}function calls, a call passed as an argument no longer causes a stray space before the following comma, and the arguments after it keep the same indentation as the other arguments.blank_line_after_tagno longer inserts a blank line when the next line closes a block and decreases the indentation, e.g. between{% endblock %}and</div>.blank_line_before_tagnow inserts the blank line above a comment directly preceding the tag, keeping the comment attached to the tag it documents.Linter:
<slot></slot>: an empty slot element is the standard way to declare a default slot outlet.{% if %}/{% else %}and closed once outside it (and vice versa for close tags), since only one branch renders.<b>in<h1>blah <b>bold</h1>.{% endblock %}is on the same line as its{% block ... %}, e.g.{% block title %}{% endblock %}. The formatter keeps such blocks on one line, so the linter and formatter no longer conflict.{% verbatim %}...{% endverbatim %}blocks, matching the existing treatment of jinja{% raw %}blocks.Configuration:
ignore,include,custom_blocks,custom_html,exclude,extend_exclude,ignore_blocks,blank_line_after_tag,blank_line_before_tag) can now also be given as lists, e.g.ignore = ["H017", "H031"]inpyproject.toml; previously list values were silently ignored.--max-blank-linesgiven on the command line is no longer overridden by the config file, matching all other options.v1.40.10Compare Source
Fix
AttributeError: attribute 'reformat' of 'Config' objects is not writablewhen linting or formatting multiple files, andAttributeError: attribute 'start' of 'TagToken' objects is not writablewhen processing a file.v1.40.9Compare Source
Fix
{% cache %},{% timezone %},{% localtime %}and{% localize %}blocks instead of dedenting everything after them.<c-card>and<c-forms.input />as block HTML tags without requiringcustom_htmlconfiguration.<b>bold</b><span> </span><i>italic</i>keep rendering a space; non-collapsible whitespace such as U+2005 is kept verbatim._attribute values, where a newline separates commands and--comments run to the end of the line.classandstylevalues are spread over multiple lines withformat_attribute_template_tags.{% comment %}block content untouched when reformatting, e.g. bare URLs ending in/>.djlint:off RULEsuppression to any finding overlapping the region, so reformatted guards keep linting clean.{% if x %}data-{% endif %}srcset.v1.40.8Compare Source
Fix
idorclassis followed by a spaced equals sign.embedblocks.excludeandextend_excludefor explicitly provided files.v1.40.7Compare Source
Fix
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate.
28097d3bb09e84662008chore(deps): update dependency djlint to >=1.40.7to chore(deps): update dependency djlint to >=1.40.89e8466200899d50e5b98chore(deps): update dependency djlint to >=1.40.8to chore(deps): update dependency djlint to >=1.40.999d50e5b98f7577b47d5chore(deps): update dependency djlint to >=1.40.9to chore(deps): update dependency djlint to >=1.41.0f7577b47d5de98ad753bchore(deps): update dependency djlint to >=1.41.0to chore(deps): update dependency djlint to >=1.42.1de98ad753bde905838a8chore(deps): update dependency djlint to >=1.42.1to chore(deps): update dependency djlint to >=1.42.2de905838a8bc20e2719cchore(deps): update dependency djlint to >=1.42.2to chore(deps): update dependency djlint to >=1.42.3bc20e2719c7ecc044a8echore(deps): update dependency djlint to >=1.42.3to chore(deps): update dependency djlint to >=1.43.07ecc044a8e1b4d14ea89chore(deps): update dependency djlint to >=1.43.0to chore(deps): update dependency djlint to >=1.43.11b4d14ea89251c5b0436chore(deps): update dependency djlint to >=1.43.1to chore(deps): update dependency djlint to >=1.43.2251c5b04364143494b94chore(deps): update dependency djlint to >=1.43.2to chore(deps): update dependency djlint to >=1.44.0View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.