Skip to content

Commit dab4e71

Browse files
add simple test project (#132)
1 parent f778bef commit dab4e71

File tree

16 files changed

+263
-0
lines changed

16 files changed

+263
-0
lines changed

.lazy.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
vim.lsp.config["djls"] = {
2+
cmd = { "djls", "serve" },
3+
filetypes = { "htmldjango" },
4+
root_markers = { "manage.py", "pyproject.toml" },
5+
}
6+
vim.lsp.enable("djls")
7+
return {}

pyproject.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,21 @@ version_pattern = "MAJOR.MINOR.PATCH[-TAG[.NUM]]"
9393
'current_version = "{version}"',
9494
]
9595

96+
[tool.djlint]
97+
blank_line_after_tag = "endblock,extends,load"
98+
blank_line_before_tag = "block"
99+
format_css = true
100+
format_js = true
101+
ignore = "H031" # Don't require `meta` tag keywords
102+
indent = 2
103+
profile = "django"
104+
105+
[tool.djlint.css]
106+
indent_size = 2
107+
108+
[tool.djlint.js]
109+
indent_size = 2
110+
96111
[tool.maturin]
97112
manifest-path = "crates/djls/Cargo.toml"
98113
strip = true

tests/project/djls_app/__init__.py

Whitespace-only changes.

tests/project/djls_app/admin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

tests/project/djls_app/apps.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class DjlsAppConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'djls_app'

tests/project/djls_app/migrations/__init__.py

Whitespace-only changes.

tests/project/djls_app/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.db import models
2+
3+
# Create your models here.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{% load static %}
2+
3+
<!DOCTYPE html>
4+
<html>
5+
<head>
6+
<title>Test Page</title>
7+
</head>
8+
<body>
9+
<h1>Hello, {{ user.username }}!</h1>
10+
<p>This is a test template.</p>
11+
{% if items %}
12+
<ul>
13+
{% for item in items %}<li>{{ item.name }}</li>{% endfor %}
14+
</ul>
15+
{% else %}
16+
<p>No items found.</p>
17+
{% endif %}
18+
<img src="{% static 'images/logo.png' %}" alt="Logo">
19+
{# This is a comment #}
20+
21+
{% block content %}
22+
{% endblock content %}
23+
24+
</body>
25+
</html>

tests/project/djls_app/tests.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

tests/project/djls_app/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.shortcuts import render
2+
3+
# Create your views here.

0 commit comments

Comments
 (0)