Skip to content

chore: ignore Simple API templates from djlint formatting #18276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ exclude_lines = [
indent = 2
profile = "jinja"
use_gitignore = true
# The Simple API templates have structures that are relied upon.
extend_exclude = "warehouse/templates/api/simple/*"
# TODO: Evaluate which `img` tags can get height/width attributes and remove H006.
# H006: <img> tag should have `height` and `width` attributes.
# TODO: Convert single quotes to double quotes and remove T002 from ignore.
Expand Down
11 changes: 1 addition & 10 deletions warehouse/templates/api/simple/detail.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{# SPDX-License-Identifier: Apache-2.0 -#}
<!DOCTYPE html>
{# djlint:off H030,H031 #}
<html lang="en">
{# djlint:on #}
<head>
<meta name="pypi:repository-version" content="{{ meta['api-version'] }}">
{% for alt_repo in alternate_locations %}<meta name="pypi:alternate-locations" content="{{ alt_repo }}">{% endfor %}
Expand All @@ -11,14 +9,7 @@
<body>
<h1>Links for {{ name }}</h1>
{% for file in files -%}
<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 />
<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 />
{% endfor -%}
</body>
</html>
Expand Down
4 changes: 1 addition & 3 deletions warehouse/templates/api/simple/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
{# SPDX-License-Identifier: Apache-2.0 -#}
<!DOCTYPE html>
{# djlint:off H030,H031 #}
<html lang="en">
{# djlint:on #}
<head>
<meta name="pypi:repository-version" content="{{ meta['api-version'] }}">
<title>Simple index</title>
</head>
<body>
{% for project in projects -%}
<a href="{{ request.route_path('api.simple.detail', name=project.name|canonicalize_name) }}">{{ project.name }}</a>
<a href="{{ request.route_path('api.simple.detail', name=project.name|canonicalize_name) }}">{{ project.name }}</a>
{% endfor -%}
</body>
</html>
Loading