Skip to content

Commit b5b29c0

Browse files
authored
chore: ignore Simple API templates from djlint formatting (#18276)
1 parent 3a1f8c8 commit b5b29c0

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ exclude_lines = [
3333
indent = 2
3434
profile = "jinja"
3535
use_gitignore = true
36+
# The Simple API templates have structures that are relied upon.
37+
extend_exclude = "warehouse/templates/api/simple/*"
3638
# TODO: Evaluate which `img` tags can get height/width attributes and remove H006.
3739
# H006: <img> tag should have `height` and `width` attributes.
3840
# TODO: Convert single quotes to double quotes and remove T002 from ignore.

warehouse/templates/api/simple/detail.html

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{# SPDX-License-Identifier: Apache-2.0 -#}
22
<!DOCTYPE html>
3-
{# djlint:off H030,H031 #}
43
<html lang="en">
5-
{# djlint:on #}
64
<head>
75
<meta name="pypi:repository-version" content="{{ meta['api-version'] }}">
86
{% for alt_repo in alternate_locations %}<meta name="pypi:alternate-locations" content="{{ alt_repo }}">{% endfor %}
@@ -11,14 +9,7 @@
119
<body>
1210
<h1>Links for {{ name }}</h1>
1311
{% for file in files -%}
14-
<a href="{{ file.url }}#sha256={{ file.hashes.sha256 }}"
15-
{% if file.get('requires-python') %}data-requires-python="{{ file['requires-python'] }}"{% endif %}
16-
{% if file.yanked %}data-yanked="{% if file.yanked is string %}{{ file.yanked }}{% endif %}
17-
"
18-
{% endif %}
19-
{% if file['core-metadata'] %}data-dist-info-metadata="sha256={{ file['core-metadata']['sha256'] }}" data-core-metadata="sha256={{ file['core-metadata']['sha256'] }}"{% endif %}
20-
{% if file.get('provenance') %}data-provenance="{{ file['provenance'] }}"{% endif %}>{{ file.filename }}</a>
21-
<br />
12+
<a href="{{ file.url }}#sha256={{ file.hashes.sha256 }}" {% if file.get('requires-python') %}data-requires-python="{{ file['requires-python'] }}" {% endif %}{% if file.yanked %}data-yanked="{% if file.yanked is string %}{{ file.yanked }}{% endif %}" {% endif %}{% if file['core-metadata'] %}data-dist-info-metadata="sha256={{ file['core-metadata']['sha256'] }}" data-core-metadata="sha256={{ file['core-metadata']['sha256'] }}"{% endif %}{% if file.get('provenance') %} data-provenance="{{ file['provenance'] }}"{% endif %}>{{ file.filename }}</a><br />
2213
{% endfor -%}
2314
</body>
2415
</html>
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
{# SPDX-License-Identifier: Apache-2.0 -#}
22
<!DOCTYPE html>
3-
{# djlint:off H030,H031 #}
43
<html lang="en">
5-
{# djlint:on #}
64
<head>
75
<meta name="pypi:repository-version" content="{{ meta['api-version'] }}">
86
<title>Simple index</title>
97
</head>
108
<body>
119
{% for project in projects -%}
12-
<a href="{{ request.route_path('api.simple.detail', name=project.name|canonicalize_name) }}">{{ project.name }}</a>
10+
<a href="{{ request.route_path('api.simple.detail', name=project.name|canonicalize_name) }}">{{ project.name }}</a>
1311
{% endfor -%}
1412
</body>
1513
</html>

0 commit comments

Comments
 (0)