Skip to content

Commit

Permalink
Merge pull request #122 from stuartmaxwell:pre-commit-djade
Browse files Browse the repository at this point in the history
Pre-commit-djade
  • Loading branch information
stuartmaxwell authored Oct 11, 2024
2 parents 415111b + 20af5d1 commit 007c07a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 8 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 6 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "base.html" %}

{% block title %}Markdown Editor{% endblock title %}
{% block title %}Markdown Editor{% endblock %}

{% block head %}
<script type="module" src="https://pyscript.net/releases/2024.6.1/core.js"></script>
Expand Down
7 changes: 3 additions & 4 deletions templates/base.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% load static %}
{% load djpress_tags %}
{% load djpress_tags static %}

<!DOCTYPE html>
<html lang="en">
Expand All @@ -19,7 +18,7 @@
{% if not debug %}
<script async src="https://u.amanzi.nz/script.js" data-website-id="d5f479d8-65fb-4f80-9823-5fe5ca2e17aa"></script>
{% endif %}
{% block head %}{% endblock head %}
{% block head %}{% endblock %}
</head>
<body>
<header>
Expand All @@ -28,7 +27,7 @@

<main class="container">
{% block content %}
{% endblock %}
{% endblock content %}
</main>

</body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{% extends "base.html" %}
{% load static %}

{% block title %}Timezone Converter{% endblock title %}
{% block title %}Timezone Converter{% endblock %}

{% block head %}
<script src="{% static "js/htmx_2.0.0.min.js" %}"></script>
{% endblock head %}


{% block content %}

<h1>Timezone Converter</h1>
Expand Down

0 comments on commit 007c07a

Please sign in to comment.