Skip to content

Commit

Permalink
fix(quality): formatage des balises script dans le gabarit `base.ht…
Browse files Browse the repository at this point in the history
…ml` (#651)

## Description

🎸 correction du formatage des balises scripts dans le gabarit
`base.html`, en lien avec [l'issue 824
djlint](djlint/djLint#824) : set
`tool.djlint.format_js` à `false

🎸 mise à jour des paramètres des linters dans `pyproject.toml` pour
résoudre les warning de l'issue #648

## Type de changement

🪲 Correction de bug (changement non cassant qui corrige un problème).
🚧 technique
  • Loading branch information
vincentporte authored Jun 3, 2024
1 parent 8a6bb3b commit 0be3c8b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
<div id="postinfeedarea{{ topic.pk }}">
{% include "forum_conversation/partials/post_feed_form_collapsable.html" with post_form=form inline=1 %}
</div>
{# djlint:off #}
<script>
document.getElementById(`collapseButtonPost{{topic.pk}}`).setAttribute('aria-expanded', 'false');
</script>
{# djlint:on #}
8 changes: 2 additions & 6 deletions lacommunaute/templates/layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,15 @@
{% block js %}
{% import_static_JS_theme_inclusion %}
<script src="{% static 'machina/build/js/machina.min.js' %}" type="text/javascript" charset="utf-8"></script>
{# djlint: off #}
<script type="text/javascript" nonce="{{ request.csp_nonce }}">
$(function() {
machina.init();
{% block onbodyload %}{% endblock onbodyload %}
});
</script>
{# djlint: on #}
</script>
{% endblock %}
{% block extra_js %}
<script src="{% static "vendor/tarteaucitron.js-1.11.0/tarteaucitron.js" %}"></script>
{# djlint: off #}
<script nonce="{{ request.csp_nonce }}">
// Tarteaucitron's language is set according to the browser configuration
// but a lot of users don't know how to change it.
Expand Down Expand Up @@ -180,8 +177,7 @@
tarteaucitron.user.matomoHost = '{{ MATOMO_BASE_URL }}';
(tarteaucitron.job = tarteaucitron.job || []).push('matomo');
{% endif %}
</script>
{# djlint: on #}
</script>
{% if MATOMO_BASE_URL %}
<script type="text/javascript" src="{% static 'javascripts/matomo.js' %}" defer></script>
{% endif %}
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ export_dev = { shell = "poetry export --with dev --output requirements/dev.txt"
line_length = 119

[tool.ruff]
ignore = []
line-length = 119

[tool.ruff.lint]
ignore = []
# see prefixes in https://beta.ruff.rs/docs/rules/
select = [
"F", # pyflakes
Expand All @@ -72,7 +74,7 @@ select = [
"I", # isort
]

[tool.ruff.isort]
[tool.ruff.lint.isort]
combine-as-imports = true
known-first-party = ["lacommunaute"]
lines-after-imports = 2
Expand All @@ -82,4 +84,4 @@ profile="django"
ignore="T002,T003,T027,H006,H023,D018"
max_attribute_length=200
format_css = true
format_js = true
format_js = false

0 comments on commit 0be3c8b

Please sign in to comment.