From d285211199c0bc64d68b536a237272559ea92a3e Mon Sep 17 00:00:00 2001
From: Dominik Hendzel <128628266+hendzeld@users.noreply.github.com>
Date: Thu, 4 Apr 2024 19:13:12 +0200
Subject: [PATCH 2/5] Add djlint configuration
---
.pre-commit-config.yaml | 9 +++++++++
pyproject.toml | 3 +++
2 files changed, 12 insertions(+)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index dd5aa04a..07f6ac3a 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -63,6 +63,15 @@ repos:
language: python
additional_dependencies: [pygments, restructuredtext_lint]
+ - repo: local
+ hooks:
+ - id: djlint
+ name: djlint
+ entry: djlint
+ files: \.jinja2$
+ language: python
+ additional_dependencies: [djlint]
+
- repo: https://github.com/elidupuis/mirrors-sass-lint
rev: "5cc45653263b423398e4af2561fae362903dd45d"
hooks:
diff --git a/pyproject.toml b/pyproject.toml
index 2edb64fa..073bd538 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -97,3 +97,6 @@ version-file = "src/pytest_html/__version.py"
[tool.hatch.build.hooks.custom]
path = "scripts/npm.py"
+
+[tool.djlint]
+profile="jinja"
From d729a7aac1324e86b55877a36950121e53a9d2e3 Mon Sep 17 00:00:00 2001
From: Dominik Hendzel <128628266+hendzeld@users.noreply.github.com>
Date: Thu, 4 Apr 2024 19:27:46 +0200
Subject: [PATCH 3/5] Ignore some basic errors
From djlint output:
H005 2:0 Html tag should have lang attribute.
H016 2:0 Missing title tag in html.
H030 2:0 Consider adding a meta description.
H031 2:0 Consider adding meta keywords.
H006 48:20 Img tag should have height and width attributes.
H013 48:20 Img tag should have an alt attribute.
H025 87:112 Tag seems to be an orphan.
Linted 1 file, found 7 errors.
---
pyproject.toml | 1 +
1 file changed, 1 insertion(+)
diff --git a/pyproject.toml b/pyproject.toml
index 073bd538..e561fb3e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -100,3 +100,4 @@ path = "scripts/npm.py"
[tool.djlint]
profile="jinja"
+ignore="H005,H016,H030,H031,H006,H013"
From 87c467c5de491b3bd3eb7565edf23ff0e92b92e5 Mon Sep 17 00:00:00 2001
From: Dominik Hendzel <128628266+hendzeld@users.noreply.github.com>
Date: Thu, 4 Apr 2024 19:37:23 +0200
Subject: [PATCH 4/5] Fix input tag
Removed extra `/` that caused reporting of next tag
---
src/pytest_html/resources/index.jinja2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pytest_html/resources/index.jinja2 b/src/pytest_html/resources/index.jinja2
index d178d4d9..587b6756 100644
--- a/src/pytest_html/resources/index.jinja2
+++ b/src/pytest_html/resources/index.jinja2
@@ -82,7 +82,7 @@
{%- for result, values in outcomes.items() %}
-
+
{{ values["value"] }} {{ values["label"] }}{{ "," if result != "rerun" }}
{%- endfor %}
From 7ead86b4e19ab3a9e8009d6bd068dde16d3bd18e Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
<66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Mon, 25 Nov 2024 12:18:57 +0000
Subject: [PATCH 5/5] [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---
pyproject.toml | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index 9a92d90e..51f6cc43 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -95,10 +95,6 @@ version-file = "src/pytest_html/__version.py"
[tool.hatch.build.hooks.custom]
path = "scripts/npm.py"
-[tool.djlint]
-profile="jinja"
-ignore="H005,H016,H030,H031,H006,H013"
-
[tool.mypy]
check_untyped_defs = false # TODO
disallow_any_generics = true
@@ -116,3 +112,6 @@ warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
+[tool.djlint]
+profile = "jinja"
+ignore = "H005,H016,H030,H031,H006,H013"