From 8f089bb012c527ea47d5220c0bd8bc3012d7cd98 Mon Sep 17 00:00:00 2001 From: Stuart Maxwell Date: Sat, 12 Oct 2024 07:38:16 +1300 Subject: [PATCH 1/3] Install Djade and upgrade pre-commit hooks --- .pre-commit-config.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2f4a308..1af6296 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: - id: check-case-conflict - id: check-merge-conflict - repo: https://github.com/adamchainz/django-upgrade - rev: "1.21.0" # replace with latest tag on GitHub + rev: "1.22.1" # replace with latest tag on GitHub hooks: - id: django-upgrade args: [--target-version, "4.2"] # Replace with Django version @@ -28,6 +28,11 @@ repos: hooks: - id: curlylint exclude: 'templates/snippets/timetable_search\.html' + - repo: https://github.com/adamchainz/djade-pre-commit + rev: "1.3.0" + hooks: + - id: djade + args: [--target-version, "5.1"] - repo: https://github.com/rtts/djhtml rev: 3.0.6 hooks: From dfe89b7ab4f3319081733369c9b3c44501592081 Mon Sep 17 00:00:00 2001 From: Stuart Maxwell Date: Sat, 12 Oct 2024 07:38:23 +1300 Subject: [PATCH 2/3] Djade changes --- .../templates/markdown_editor/markdown_editor.html | 2 +- templates/base.html | 7 +++---- .../templates/timezone_converter/converter.html | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/markdown_editor/templates/markdown_editor/markdown_editor.html b/markdown_editor/templates/markdown_editor/markdown_editor.html index 12e478d..77aa27a 100644 --- a/markdown_editor/templates/markdown_editor/markdown_editor.html +++ b/markdown_editor/templates/markdown_editor/markdown_editor.html @@ -1,6 +1,6 @@ {% extends "base.html" %} -{% block title %}Markdown Editor{% endblock title %} +{% block title %}Markdown Editor{% endblock %} {% block head %} diff --git a/templates/base.html b/templates/base.html index f4823f1..5f3288b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,5 +1,4 @@ -{% load static %} -{% load djpress_tags %} +{% load djpress_tags static %} @@ -19,7 +18,7 @@ {% if not debug %} {% endif %} - {% block head %}{% endblock head %} + {% block head %}{% endblock %}
@@ -28,7 +27,7 @@
{% block content %} - {% endblock %} + {% endblock content %}
diff --git a/timezone_converter/templates/timezone_converter/converter.html b/timezone_converter/templates/timezone_converter/converter.html index fb09d1d..5d821bd 100644 --- a/timezone_converter/templates/timezone_converter/converter.html +++ b/timezone_converter/templates/timezone_converter/converter.html @@ -1,13 +1,12 @@ {% extends "base.html" %} {% load static %} -{% block title %}Timezone Converter{% endblock title %} +{% block title %}Timezone Converter{% endblock %} {% block head %} {% endblock head %} - {% block content %}

Timezone Converter

From 20af5d1d3e565a413dbc1c717562f6d81d25185a Mon Sep 17 00:00:00 2001 From: Stuart Maxwell Date: Sat, 12 Oct 2024 07:47:56 +1300 Subject: [PATCH 3/3] Add tests to pull request --- .github/workflows/test.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d02d42d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,19 @@ +name: Test + +on: pull_request + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v2 + + - name: Run tests + run: uv run --frozen --python 3.13 pytest