🚨 — Improve djlint test and fix its warnings/errors

This commit is contained in:
Luc Didry 2023-12-12 07:30:16 +01:00
parent 024fd4c911
commit 76bd10108d
No known key found for this signature in database
GPG key ID: EA868E12D0257E3C
8 changed files with 20 additions and 20 deletions

View file

@ -21,7 +21,7 @@ cog: ## Run cog, to integrate the CLI options to the docs.
tests: venv ## Run the tests tests: venv ## Run the tests
venv/bin/pytest venv/bin/pytest
djlint: venv ## Format the templates djlint: venv ## Format the templates
venv/bin/djlint --ignore=H030,H031,H006 --lint argos/server/templates/*html venv/bin/djlint --ignore=H030,H031,H006 --profile jinja --lint argos/server/templates/*html
pylint: venv ## Runs pylint on the code pylint: venv ## Runs pylint on the code
venv/bin/pylint argos venv/bin/pylint argos
lint: djlint pylint lint: djlint pylint

View file

@ -1,5 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}<h2>Agents</h2>{% endblock %} {% block title %}<h2>Agents</h2>{% endblock title %}
{% block content %} {% block content %}
<table role="grid"> <table role="grid">
<thead> <thead>
@ -17,4 +17,4 @@
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
{% endblock %} {% endblock content %}

View file

@ -52,11 +52,11 @@
<main class="container"> <main class="container">
<div id="header"> <div id="header">
{% block title %} {% block title %}
{% endblock %} {% endblock title %}
</div> </div>
<div id="content"> <div id="content">
{% block content %} {% block content %}
{% endblock %} {% endblock content %}
</div> </div>
</main> </main>
<footer class="text-center"> <footer class="text-center">

View file

@ -1,5 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}<h2>{{ domain }}</h2>{% endblock %} {% block title %}<h2>{{ domain }}</h2>{% endblock title %}
{% block content %} {% block content %}
<div id="domains" class="frame"> <div id="domains" class="frame">
<table id="domains-list" role="grid"> <table id="domains-list" role="grid">
@ -25,9 +25,9 @@
href="{{ url_for('get_result_view', result_id=task.last_result.id) }}"> href="{{ url_for('get_result_view', result_id=task.last_result.id) }}">
{% if task.status == "success" %} {% if task.status == "success" %}
✅ Success ✅ Success
{% elif task.status == "error"%} {% elif task.status == "error" %}
⚠ Error ⚠ Error
{% elif task.status == "failure"%} {% elif task.status == "failure" %}
❌ Failure ❌ Failure
{% elif task.status == "unknown" %} {% elif task.status == "unknown" %}
❔ Unknown ❔ Unknown
@ -43,4 +43,4 @@
</tbody> </tbody>
</table> </table>
</div> </div>
{% endblock %} {% endblock content %}

View file

@ -1,11 +1,11 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}<h2>Tasks list</h2>{% endblock %} {% block title %}<h2>Tasks list</h2>{% endblock title %}
{% block content %} {% block content %}
<div id="domains" class="frame"> <div id="domains" class="frame">
<nav> <nav>
<ul> <ul>
<li> <li>
{{ domains | length}} domains, {{ domains | length }} domains,
{{ total_task_count }} tasks, {{ total_task_count }} tasks,
<a href="{{ url_for('get_agents_view') }}"> <a href="{{ url_for('get_agents_view') }}">
{{ agents | length }} agent{{ 's' if agents | length > 1 }} {{ agents | length }} agent{{ 's' if agents | length > 1 }}
@ -45,9 +45,9 @@
<td class="status highlight"> <td class="status highlight">
{% if status == "ok" %} {% if status == "ok" %}
✅ OK ✅ OK
{% elif status == "warning"%} {% elif status == "warning" %}
⚠️ Warning ⚠️ Warning
{% elif status == "critical"%} {% elif status == "critical" %}
❌ Critical ❌ Critical
{% elif status == "unknown" %} {% elif status == "unknown" %}
❔ Unknown ❔ Unknown
@ -76,4 +76,4 @@
} }
}); });
</script> </script>
{% endblock %} {% endblock content %}

View file

@ -1,5 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}<h2>Dashboard</h2>{% endblock %} {% block title %}<h2>Dashboard</h2>{% endblock title %}
{% block content %} {% block content %}
<div id="domains" class="frame"> <div id="domains" class="frame">
<<<<<<< HEAD <<<<<<< HEAD
@ -69,4 +69,4 @@
</p> </p>
</div> </div>
</div> </div>
{% endblock %} {% endblock content %}

View file

@ -1,5 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}<h2>{{ result }}</h2>{% endblock %} {% block title %}<h2>{{ result }}</h2>{% endblock title %}
{% block content %} {% block content %}
<dl> <dl>
<dt>Task</dt> <dt>Task</dt>
@ -13,4 +13,4 @@
<dt>Context</dt> <dt>Context</dt>
<dd>{{ result.context }}</dd> <dd>{{ result.context }}</dd>
</dl> </dl>
{% endblock %} {% endblock content %}

View file

@ -1,5 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}<h2>{{ task }}</h2>{% endblock %} {% block title %}<h2>{{ task }}</h2>{% endblock title %}
{% block content %} {% block content %}
<code>{{ description }}</code> <code>{{ description }}</code>
<table role="grid"> <table role="grid">
@ -23,4 +23,4 @@
</tbody> </tbody>
</table> </table>
{% endblock %} {% endblock content %}