Skip to content

Commit 55a92a4

Browse files
Fix report template, add djlint configuration (#804)
* Ignore some basic errors From djlint output: H005 2:0 Html tag should have lang attribute. <html> <head> H016 2:0 Missing title tag in html. <html> <head> H030 2:0 Consider adding a meta description. <html> <head> H031 2:0 Consider adding meta keywords. <html> <head> H006 48:20 Img tag should have height and width attributes. <img src="" /> H013 48:20 Img tag should have an alt attribute. <img src="" /> H025 87:112 Tag seems to be an orphan. </span> * Fix input tag Removed extra `/` that caused reporting of next </span> tag Co-authored-by: Pierre Sassoulas <[email protected]>
1 parent 656506d commit 55a92a4

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ repos:
7676
language: python
7777
additional_dependencies: [pygments, restructuredtext_lint]
7878

79+
- repo: local
80+
hooks:
81+
- id: djlint
82+
name: djlint
83+
entry: djlint
84+
files: \.jinja2$
85+
language: python
86+
additional_dependencies: [djlint]
87+
7988
- repo: https://github.com/elidupuis/mirrors-sass-lint
8089
rev: "5cc45653263b423398e4af2561fae362903dd45d"
8190
hooks:

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,7 @@ warn_redundant_casts = true
111111
warn_return_any = true
112112
warn_unreachable = true
113113
warn_unused_configs = true
114+
115+
[tool.djlint]
116+
profile = "jinja"
117+
ignore = "H005,H016,H030,H031,H006,H013"

src/pytest_html/resources/index.jinja2

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<tr id="not-found-message">
3232
<td colspan="{{ table_head|length }}">No results found. Check the filters.</td>
3333
</tr>
34+
</tbody>
3435
</template>
3536
<template id="template_results-table__tbody">
3637
<tbody class="results-table-row">
@@ -41,14 +42,14 @@
4142
<div class="extraHTML"></div>
4243
<div class="media">
4344
<div class="media-container">
44-
<div class="media-container__nav--left"><</div>
45+
<div class="media-container__nav--left">&lt;</div>
4546
<div class="media-container__viewport">
4647
<img src="" />
4748
<video controls>
4849
<source src="" type="video/mp4">
4950
</video>
5051
</div>
51-
<div class="media-container__nav--right">></div>
52+
<div class="media-container__nav--right">&gt;</div>
5253
</div>
5354
<div class="media__name"></div>
5455
<div class="media__counter"></div>
@@ -81,7 +82,7 @@
8182
<div class="controls">
8283
<div class="filters">
8384
{%- for result, values in outcomes.items() %}
84-
<input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="{{ result }}" {{ "disabled" if values["value"] == 0 }}/>
85+
<input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="{{ result }}" {{ "disabled" if values["value"] == 0 }}>
8586
<span class="{{ result }}">{{ values["value"] }} {{ values["label"] }}{{ "," if result != "rerun" }}</span>
8687
{%- endfor %}
8788
</div>

0 commit comments

Comments
 (0)