Skip to main content

# jinjalint

A prototype linter which checks the indentation and the correctness of
[Jinja][jinja]-like/HTML templates. Can [fix issues][django-commit].

It works with [Django’s templates][djangotemplates] too, it should
work with [Twig](https://twig.symfony.com/) and similar template languages.
It should work fine with any kind of HTML 4 and 5, hovewer XHTML is not
supported.

This linter parses both HTML and Jinja tags and will report mismatched
tags and indentation errors:

```html+jinja
<div>
{% if something %}
</div>
{% endif %}
```

```html+jinja
<div>
<span>
</div>
</span>
```

```html+jinja
{% if something %}
<div> not indented properly
</div>
{% endif %}
```

```html+jinja
{% if something %}<a href="somewhere">{% endif %}
<p>something</p>
{% if not something %}</a>{% endif %}
```

## Usage

You need Python 3. Jinjalint doesn’t work with Python 2. Install it with
`pip install jinjalint` (or `pip3 install jinjalint` depending on how `pip` is
called on your system), then run it with:

```sh
$ jinjalint template-directory/
```

…or:

```sh
$ jinjalint some-file.html some-other-file.html
```

This is a work in progress. Feel free to contribute :upside_down_face:

[jinja]: http://jinja.pocoo.org/docs/2.9/
[django-commit]: https://github.com/django/djangoproject.com/commit/14a964d626196c857809d9b3b492ff4cfa4b3f40
[djangotemplates]: https://docs.djangoproject.com/en/1.11/ref/templates/language/

Metadata

Release files for jinjalint 0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jinjalint 0.5
File Size Uploaded Provenance Actions
jinjalint-0.5.tar.gz 32.3 kB Without provenance Details for jinjalint-0.5.tar.gz

Release files / jinjalint-0.5.tar.gz

Download URL jinjalint-0.5.tar.gz
Size 32.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4490e4a8f1d23de28306137b8ff5ae4a979db07b3ac9a4eb2726bf174dc41827
BLAKE2b-256 checksum
How to use checksums
30f049ad922d23b39e52fcf22038371cb22672d676825e2fad5cb2f764376d4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.6

Security for jinjalint 0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page