Skip to content
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

Pre-commit-djade #122

Merged
merged 3 commits into from
Oct 11, 2024
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
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