Django Template Linter
Project description
djlint
Simple Django template linter.
Install
pip install djlint
Usage
djlint <file or path>
Optional args
| Arg | Definition | Default |
|---|---|---|
| -e, --extension | File extension to lint. | default=html |
Rules
Error Codes
| Code | Meaning |
|---|---|
| E001 | Variables should be wrapped in a single whitespace. Ex: {{ this }} |
| E002 | Double quotes should be used in tags. Ex {% extends "this.html" %} |
Warning Codes
| Code | Meaning |
|---|---|
| W003 | Endblock should have name. Ex: {% endblock body %}. |
| W004 | Status urls should follow {% static path/to/file %} pattern. |
| W005 | Html tag should have lang attribute. |
| W006 | Img tag should have alt, height and width attributes. |
| W007 | <!DOCTYPE ... > should be present before the html tag. |
| W008 | Attributes should be double quoted. |
| W009 | Tag names should be lowercase. |
| W010 | Attribute names should be lowercase. |
| W011 | Attirbute values should be quoted. |
| W012 | There should be no spaces around attribute =. |
| W013 | Line is longer than 99 chars. |
| W014 | More than 2 blank lines. |
| W015 | Follow h tags with a blank line. |
| W016 | Missging title tag in html. |
0.0.8
Added rules.
0.0.1
Initial release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
djlint-0.0.8.tar.gz
(20.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
djlint-0.0.8-py3-none-any.whl
(17.4 kB
view details)
File details
Details for the file djlint-0.0.8.tar.gz.
File metadata
- Download URL: djlint-0.0.8.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f016edfb513bb20fbd318d34fc6d4db01bf6fb0c66bab05a7d6ecf66a509425
|
|
| MD5 |
0af3d412c9278f7a577342e9f4f73a4d
|
|
| BLAKE2b-256 |
720b2295bbc0a00a2e5a84dbda3820ae9d938e1a11b7fec3c3705e963371f914
|
File details
Details for the file djlint-0.0.8-py3-none-any.whl.
File metadata
- Download URL: djlint-0.0.8-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31617632cc959f2741097af37f2d6b518fefa96bb353e6b364be039953bce17e
|
|
| MD5 |
7bf539495ede3cb004cb6fae06981d17
|
|
| BLAKE2b-256 |
17c0c487577425a663c044c2d43835c9670122d3c842af3c832f664334c1e327
|