diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e24040a..f993008 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -62,6 +62,23 @@ repos: entry: djlint --lint language: python files: \.(html|jinja|j2)$ + - id: djlint-check + name: HTML formatter check + entry: djlint --check + language: python + files: \.(html|jinja|j2)$ + - id: check-embedded-css + name: CSS linter (embedded styles) + entry: python scripts/check_css.py + language: python + files: \.(html|jinja|j2)$ + additional_dependencies: [tinycss2==1.5.1] + - id: check-embedded-js + name: JS syntax checker (embedded scripts) + entry: python scripts/check_js.py + language: python + files: \.(html|jinja|j2)$ + additional_dependencies: [py-mini-racer==0.6.0] - id: pydocstyle name: docstring style entry: pydocstyle --convention=google diff --git a/dfetch_hub/site/index.html b/dfetch_hub/site/index.html index a4c6f6a..5760e41 100644 --- a/dfetch_hub/site/index.html +++ b/dfetch_hub/site/index.html @@ -1,25 +1,23 @@ - - - - - DFetch:hub - - - - - - - - - - - - - - - - - - -
-
- - - Repository - - - - Documentation - - - - dfetch - -
- -
- - -
-
-
-
- dfetch — the fetching dog -
-
DFetch:hub
-

Search & compose dfetch.yaml manifests

+ + + +
+ +
- -
-
0 components
-
0 registries
-
0 labels
-
-
-
-
-

Start typing to explore packages. The manifest you create can be used with dfetch.

-
-
- - -
-
- Showing 0 packages -
- - -
-
- -
-
- - -
-
-
- - -
-
-
- -
-
- - + + + +
+ +
+
+
+
+ dfetch — the fetching dog +
+

DFetch:hub

+

+ Search & compose dfetch.yaml manifests +

+
+
+ +
+
+ 0 components +
+
+ 0 registries +
+
+ 0 labels +
+
+
+
+
+

+ Start typing to explore packages. The manifest you create can be used with dfetch. +

-
-
-
-
-
-
-
-
- - -
-
-
-
-
-
-
-
- -
RefTypeSHADate
-
- -
-
- - - - -
- - - \ No newline at end of file + + + diff --git a/pyproject.toml b/pyproject.toml index 572b333..95d7d10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,8 @@ development = [ "black==25.1.0", "codespell==2.4.1", "djlint==1.36.4", + "tinycss2==1.5.1", + "py-mini-racer==0.6.0", "doc8==2.0.0", "isort==6.0.0", "mypy==1.14.1", @@ -142,7 +144,12 @@ ignore = [ known-first-party = ["dfetch_hub"] [tool.djlint] -ignore = "H021,H031" # H021: inline styles intentional in single-file app; H031: meta keywords are obsolete +profile = "html" +indent = 2 +max_line_length = 120 +format_js = false # djlint misidentifies JS regex tokens as HTML; keep script content verbatim +format_css = false # CSS is intentionally minified; keep style content verbatim +ignore = "H021,H031" # H021: inline styles intentional in single-file app; H031: meta keywords tag is obsolete [tool.doc8] max-line-length = 120 diff --git a/scripts/check_css.py b/scripts/check_css.py new file mode 100644 index 0000000..2809fbb --- /dev/null +++ b/scripts/check_css.py @@ -0,0 +1,179 @@ +"""Validate CSS embedded in HTML files using tinycss2. + +Extracts every ``