chore(deps): update dependency djlint to >=1.45.2 #659
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!659
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.44.2→>=1.45.2Release Notes
djlint/djLint (djlint)
v1.45.2Compare Source
Fix
{%-or-%}marker strips. The break normally renders the space itself, so djLint drops the space as redundant, but a stripped break renders nothing:{%- if args -%}, {% endif %}followed by{%- for %}lost the space between a macro's arguments.v1.45.1Compare Source
Fix
H037no longer reads a quoted string inside a template tag as an attribute name, sohref="{{ url "/a/b" "/a/c" }}"is not reported as a duplicatea. This started in 1.45.0.) }}to the start of the line.{{ function([nested(...)]) }}is no longer dedented by one level.{%- endif %}:</b>, keeps its own level instead of being indented one further.data-x='{{ f({ ... }) }}'no longer loses a space from every line.--single-attribute-per-linereaches attributes guarded by a template tag, so{% if x %} a="1" b="2" {% endif %}inside a tag no longer keeps them on one line past--max-line-length.--max-line-lengthis spread over several lines, where before only--max-attribute-lengthdecided. A line long because of its text is left alone, since breaking text would change what renders.<{{ tag }}>, is read as a tag. It was not recognised at all, so a template block among its attributes was pulled out of the tag and re-indented to the start of the line, and its attributes went unformatted and unchecked.v1.45.0Compare Source
Feature
H043reports a<button>written without atype. A type written inside a template block, as in<button {% if a %}type="button"{% endif %}>, counts.H044reports a header row holding boththandtdcells. The emptytdthat opens a two-axis table's header row is allowed.H045reports an<iframe>with no accessible name.title,aria-labelandaria-labelledbyall count, as does a name written by a template tag.H046reports a positivetabindex.0and-1are left alone, as is a value written by a template tag.H047reportsaria-hidden="true"on an element that takes focus. Hiding a decorative icon is not reported, nor is adisabledcontrol or one withtabindex="-1".H048reports anaria-attribute that ARIA does not define, such as a misspelledaria-lable. Framework bindings like:aria-labelare left alone.H049reports a viewport that stops the page being zoomed, byuser-scalable=noor amaximum-scalebelow 2.H050reports an element html no longer defines, such as<center>,<font>,<marquee>or<strike>. Only the opening tag is reported, and a custom element whose name merely starts with one, such as<font-picker>, is left alone.H051reports aroleARIA does not define for markup, such asrole="buton". The roles DPUB-ARIA and GRAPHICS-ARIA add count, abstract ones such aslandmarkdo not, and a value written by a template tag or a framework binding such as:roleis left alone.H052reports a<meta http-equiv="refresh">that reloads or redirects on a timer, which fails WCAG 2.2.1. A delay of zero is an immediate redirect rather than a timer and is not reported.--quote-style/quote_stylesets the quotes djLint writes inside template tags,double(the default) orsingle, andT002follows it, so{% include 'a.html' %}is no longer reported in a project that writes single quotes. Html attributes stay withH008.--sort-attributes/sort_attributesorders a tag's attributes by name, withidfirst andclasssecond. A tag whose attributes are guarded by a template tag, as in<div {% if x %}a="1"{% endif %} b="2">, keeps the order it was written in.--name-endblocks/name_endblockswrites the block's name into the{% endblock %}that closes it, where the block spans several lines, makingT003fixable by running the formatter. A block opened and closed on one line is left alone.--no-indent-inner-html/no_indent_inner_htmlleaves<head>and<body>at the same indent as the<html>that holds them, matching the default VS Code html formatter.--keep-br-inline/keep_br_inlinekeeps<br>on the line of the text it breaks instead of giving it a line of its own.<hr>is unaffected, and the default is unchanged.--prefer-configurationlets the file named by--configurationoverride the project's ownpyproject.tomlor.djlintrc, which have always won where the two set the same thing. The default is unchanged.H008asks, so<div class='a'>becomes<div class="a">. Only the names the rule reports are touched, and a value holding a double quote of its own keeps its single quotes.H010reports are lowercased by the formatter, so<div CLASS="a">is fixed rather than only reported. A name the rule does not know, such as an svgviewBox, keeps its case, and--ignore-caseturns it off.©becomes©, which is whatH023asks for. Entities that carry syntax or template meaning are left as written, as are<pre>,<textarea>,<script>and<style>bodies, and--no-entity-formattingturns it off.typethat html5 already assumes is dropped, asH024asks, so<script type="text/javascript">becomes<script>, and the same for<style>and a stylesheet<link>. A type that means something, such astype="module", is kept.methodis lowercased, somethod="POST"becomesmethod="post", which is whatH029asks for. A tag written inside a template tag's string is left alone.Changed
H031is gone: the keywords meta tag it asked for no longer affects ranking, and bing treats it as a spam signal.H035is gone;H017already coversmeta.H036reports only two uses of<br>: a run of two or more, and a break against the inside edge of a block element. Breaks that are part of the content, such as in a postal address, are left alone, and the rule is on by default.T002is on by default, and--reformatnow writes the quotes it asks for, rewriting tag arguments and conditions such as{% if x == 'a' %}to the--quote-stylein force. A string already holding the quote it would be rewritten to is left alone.T028is off by default: the whitespace it strips can be whitespace that renders, soalt="{%- if brand -%}Acme{%- endif -%} logo"comes out asAcmelogo. It stays available with--include=T028.H014counts blank lines the way the formatter does, so--max-blank-lines 2and--preserve-blank-linesno longer produce files the linter then rejects. A line holding only whitespace counts as blank, and the report points at the first blank line rather than the content line above it.H020leaves alone an element whose empty form carries meaning, such as a blank<option>holding a select open.H023no longer reports an entity for an invisible character, such as‌, in named, decimal or hex form.--ignore-caseapplies to the linter as well as the formatter, soH009andH010stay quiet when it is set.--profile=allhonours every profile'sexcludelist, soT028no longer fires on django markup to recommend{%- if -%}, which django rejects.Fix
<p title="a<br>b">is not reported: affectsD004,J004,H006,H011,H013,H017,H018,H019,H020,H021,H022,H036andH043.D004,H019andH021see attributes written after a template tag containing a>, so the inline style in<div {% if n > 5 %}id="a"{% endif %} style="color:red">is checked.<script>,<style>,<pre>and<textarea>, which used to be skipped along with the body, soH024,D004,H008,H010,H011,H012andH037can see their attributes. Only the body is skipped now, and its contents are never read as markup.D018andJ018no longer report a link that already uses a url tag, such as<a href="{% url 'profile' %}" data-src="lazy">; a value now has to look like a path./static/and/media/assets are left to{% static %}rather than reported as routes.H005reports<html lang="">, and its message asks for a non-emptylang.H005andH007ignore custom elements whose name starts withhtml, such as<html-midi-player>.H007reports a missing doctype in a file that opens with something it does not recognise, such as an<?xml ... ?>declaration.H008leaves single quoted values holding a double quote alone, such astitle='{% translate "Delete" %}'. An attribute that merely ends in a known name, such asdata-title, is no longer treated as that attribute.H009reports exactly the elements the formatter lowercases, so--reformatalways clears it:<IMG>,<INPUT>and<NAV>are now reported, andG,PATH,NAMEandCACHEare not. An uppercase name inside an attribute value, as in<p title="x <DIV y">, is no longer read as a tag.H012sees attributes written after a{{ ... }}in the same tag, so the spaced=in<div {{ attrs }} class = "x">is reported.H013accepts a valuelessalt, so<img src="a.png" alt>passes as the decorative imagealt=""already did.H016recognises a<title>however it is written, so<title id='page-title'>no longer reads as a missing title and an svg<title>no longer counts as the document's. The report points at the<html>tag.H022no longer reads anhttp://inside another attribute's value as a link, and no longer reports loopback or private hosts:localhost,127.0.0.1,192.168.x,10.xand.localor.testnames.H024covers<link rel="stylesheet" type="text/css">.H025no longer calls a tag an orphan in a handlebars or go template: a wrapper opened in one branch of{{#if}}...{{else}}...{{/if}}and closed in the other is accepted, as in django and jinja.H029reads only the form's ownmethodattribute, so<form data-method="POST">is not reported.H030stays quiet for a base layout that fills its description in per page, so a head using{% block meta %}is no longer reported.H033sees a form whose earlier attribute holds a>, as in<form x-show="count > 0" action=" /x/">.H037counts an attribute written without a value, so<input required required>is reported as the duplicate it is.H042leaves a label alone in a partial that holds no form control. A control that is commented out still counts, so the label above it is checked.T001andT027no longer read a delimiter inside a string as the end of the tag, so{{ x|default('}}') }}is reported neither as needing padding nor as holding an unclosed string. A string that really does run past the tag is still reported.T032flags extra whitespace in tags that hold a|,(,),:,?or%, which were previously skipped. A run of spaces inside a string is still content and is left alone.T034no longer flags a}%written inside a string, so{% trans "Save 50}% today" %}is left alone.T039no longer reports a valid block tag holding a nested mapping such as{% set a = {"x": {"y": 1}} %}, a shape--reformatitself produces.T040allows an empty literal that only feeds a filter, as in{% extends ""|default:"base.html" %}.<script>,<style>or<textarea>is left alone;var s = "<DIV CLASS=x>"is no longer rewritten to"<div CLASS=x>".H011asks, soclass=onebecomesclass="one". A value carrying a quote of its own, such asa=b'c, is still left alone.{% set %}or a function call keep their own quotes when they hold the other kind, so{% set s = 'say "hi"' %}is left as written instead of escaped.{{ }}stay where they are; the first is no longer pulled up against the opening bracket.{{ _("test")|upper }}keeps its shape.{{#if}}are no longer taken for the start of a Jinja comment, which left everything up to the next#}unformatted.+whitespace control marker is read wherever-is, so{%+ if x %}counts as a block tag,T038no longer misreports these blocks and the formatter indents them.{%that opens nothing no longer hides the markup after it: a page quoting template syntax in prose, as in<code>{%-</code>, is formatted rather than skipped down to the next%}.{%written inside javascript is no longer read as a template tag; a<script>holding'{%'and'%}'in its code used to leave its whole line unformatted.{% language 'de' %}text{% endlanguage %}, are recognised as balanced on a line too.<input id="a" type="checkbox">used to flip between spread and joined on every run.<script>or<style>is followed by text. Text sitting directly against the element, as ina<script>x</script>b, is still left alone, since a line break there would render as a space.<script>,<style>or<pre>, so the children of<a class="x">text<style>now sit inside it, and a closing tag written after the block's end tag gives back the level it took.<pre>,<textarea>,<script>or<style>opened and closed on one line no longer cancels a block opened earlier:<pre>x</pre><script>left the script's body indented as markup, and took a second run to settle.<pre>and<textarea>that looks like a djLint marker, such as{# djlint:on #}shown as sample code, no longer ends the verbatim block and walks its contents a level further right on every run.--preserve-leading-spaceno longer moves a line further right on every run, as it did for a multi-line{# ... #}comment and every other line inside an indented block.--preserve-leading-spaceno longer keeps a blank line on one run and drops it on the next when a<pre>or<textarea>is written with leading indentation;--blank-line-after-taghad the same drift from the second tag in its list onwards.--preserve-leading-space, the contents of a{{ if }}or{{ range }}block no longer lose an indent level when an already formatted go template is formatted again.--blank-line-before-tagno longer splits a line to place its blank line, so a tag written after other content, such as the{% block %}inside a one line{% set %}...{% endset %}, stays where it is.--blank-line-before-tagno longer inserts a blank line into an attribute value, which grew the file on every run.--blank-line-after-tagalready left attributes alone.djlint:offblock placed between a tag's attributes no longer crashes the formatter when it contains a backslash, and its text comes back exactly as written.--format-cssand--format-jsno longer indent a<style>or<script>body by the wrong amount when several files are formatted at once.djlint - --reformat --lintno longer writes its report into the file: the lint findings, the--statisticsblock and the--github-outputannotations go to stderr when stdout is carrying the formatted code. A lint-only run is unchanged.--github-outputannotations no longer land in the file either: in CI, where the flag turns itself on from$GITHUB_ACTIONS,cat f.html | djlint - --reformat > f.htmlwrote::warninglines intof.html.--statisticsprints its summary alongside GitHub annotations. It was dropped whenever the GitHub output was on, which happens by itself in a workflow.djlint -: a CRLF buffer piped to--reformatcame back LF throughout. Input that--require-pragmaskips is handed back byte for byte.<script>string was rewritten as a newline and broke the script.\U0001f622rather than an emoji.djlint . | head -1, is no longer a failure: it printed a traceback and exited120.djlint . templates/, is checked once, so it is no longer reported and counted twice or written twice under--reformat.custom_blocks,ignore_blocks,custom_html,blank_line_after_tagorblank_line_before_tag, as inignore_blocks = "raw,", is ignored instead of turning off template indentation altogether or padding every template tag in the file..gitignoreis read only when--use-gitignoreoruse_gitignoreasks for it, so a line djLint cannot parse, such as one ending in a backslash, no longer aborts every run in the project with a traceback.--require-pragmaskips a file whose first line it cannot decode instead of aborting the whole run. A file that is checked and turns out undecodable is still reported as a failure.--indent-jsand--indent-cssoverride the indent alone, leaving other beautifier settings in the config file'sjsorcssblock, such aswrap_line_length, in place.--ignoreand--includeaccept a space after the comma, so--ignore "H011, H013"no longer reportsH013.Performance
Docs
H026page no longer claims an emptyclassoridcannot be targeted: an attribute presence selector such asdiv[class]does match one, so removing the attribute can change how a page is styled.--github-output/--no-github-outputoverride that.--allow-empty-inputappears in the command line reference, which had been missing it.H042is no longer documented as off by default, which it stopped being in 1.42.1.T002is on by default.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 CLI.