Feature
- New rule
D058reports a Django tag or comment that spans lines, such as a{# #}comment written over several lines or an{% include %}whose arguments go on to the next line. Django reads a tag only within one line, so it prints these as text, and an{% if %}split that way stops the template from compiling. Anything inside a{% comment %}or{% verbatim %}block is left alone, and so is a{%or{{that another tag follows before its closing, whichT039reports. - New rule
D059, off by default, reports consecutive lines that each hold only a{# #}comment, which a{% comment %}block holds as one. Adjlint:directive and a translator comment never join such a run, and comments inside<pre>and<textarea>are left alone, since the line breaks they leave show on the page there. - djLint warns about a djLint file that sits beside the one it reads and so isn't read, such as a
djlint.tomlnext to[tool.djlint]inpyproject.toml, or a.djlintrcnext to adjlint.toml. .editorconfigfiles are read as editors read them, for each file by its own path: the nearest.editorconfigwins, the ones above it fill in what it leaves out, and one withroot = trueends the search, which goes no higher than the project root. Sections match by the EditorConfig globs, paths included, so[pages/*.html]sets only the templates inpages, andunsetdrops a value that a file above gives. Only the project root's.editorconfigwas read, and its settings went to every file of the run.
Bug fixes
- A switch in a configuration file takes
trueorfalseagain, nothing else. 1.51.0 also read"yes","on","1"and other words for one, which is now an error naming the file. The text"true"or"false"still works, with a warning to write it without quotes, and so does a number written as text, such as"100". - The warning about a code in
includethat never runs no longer names thehtmlprofile when none is set. It says the rule never runs without a profile, where the linter followshtml. - A
pyproject.tomlwithout djLint settings no longer stops the search for the configuration, so a package in a monorepo with its ownpyproject.tomlgets the settings of the repository instead of none. The search still stops at a folder with adjlint.toml,.djlint.toml,.djlintrc,.djlint_rules.yamlor apyproject.tomlwith[tool.djlint], and never goes past the root of the repository (.gitor.hg).