Skip to main content

A fast HTML template linter and formatter, ported from djlint to Rust.

Project description

djlintr

A fast HTML template linter and formatter. Port of djlint to Rust.

Currently only supports HTML and Django templates; Jinja2 and Nunjucks to be added in the future.

Installation

You can install djlintr directly from PyPI using pip or uv:

pip install djlintr
# or
uv pip install djlintr

Alternatively, you can grab one of the binary release files from GitHub.

Or, to install djlintr from source, ensure you have Rust installed and run:

cargo install --path .

Usage

djlintr [OPTIONS] <PATHS>...

Arguments

  • <PATHS>...: Files or directories to process.

Options

  • -r, --reformat: Reformat files.
  • -l, --lint: Lint files.
  • -e, --extension <EXTENSION>: File extensions to include (default: html).
  • -t, --threads <THREADS>: Number of threads to use.
  • --check: Return non-zero exit code if issues are found.
  • --max-attribute-length <MAX_ATTRIBUTE_LENGTH>: Maximum length for attributes before wrapping (default: 70).
  • --custom-blocks <CUSTOM_BLOCKS>: Comma-separated list of custom block tags.
  • -h, --help: Print help.
  • -V, --version: Print version.

Configuration

djlintr automatically searches for a .djlintrc (JSON) file or a pyproject.toml file in the current directory.

Supported Options

  • indent: Number of spaces for indentation (default: 4).
  • max_line_length: Maximum line length (default: 120).
  • max_attribute_length: Maximum length for attributes before wrapping (default: 70).
  • ignore: A list of rule codes to ignore.
  • custom_blocks: A list of custom block tags.

Example .djlintrc

{
  "indent": 2,
  "max_line_length": 100,
  "ignore": ["H006", "T001"]
}

Example pyproject.toml

djlintr supports both [tool.djlint] and [tool.djlintr] sections.

[tool.djlintr]
indent = 2
max_line_length = 100
ignore = ["H006", "T001"]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djlintr-0.5.12.tar.gz (86.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

djlintr-0.5.12-py3-none-win_amd64.whl (1.3 MB view details)

Uploaded Python 3Windows x86-64

djlintr-0.5.12-py3-none-manylinux_2_34_x86_64.whl (1.4 MB view details)

Uploaded Python 3manylinux: glibc 2.34+ x86-64

djlintr-0.5.12-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

djlintr-0.5.12-py3-none-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

djlintr-0.5.12-py3-none-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file djlintr-0.5.12.tar.gz.

File metadata

  • Download URL: djlintr-0.5.12.tar.gz
  • Upload date:
  • Size: 86.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for djlintr-0.5.12.tar.gz
Algorithm Hash digest
SHA256 91a62921a183a111382809275f0e7c2b5cf31978059ae20e685db53ef9c31ccd
MD5 9a0f1a8351d82141a82fc38881ba8db8
BLAKE2b-256 145d3c06beccdd708cd66946280f18b83cb4407e4807fef357e0590f1ffbfe91

See more details on using hashes here.

Provenance

The following attestation bundles were made for djlintr-0.5.12.tar.gz:

Publisher: pypi.yml on thraxil/djlintr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djlintr-0.5.12-py3-none-win_amd64.whl.

File metadata

  • Download URL: djlintr-0.5.12-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for djlintr-0.5.12-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 5ea75cee4d8d2d17a65cae47c6038474ad22b9b1a75af773af5fdace911859d5
MD5 6e471625568e868da5b26e5502c50a45
BLAKE2b-256 8e10fce56b9c3cf147d808b949e5a86a2a64eee1fed8441a646f5cbef5662da3

See more details on using hashes here.

Provenance

The following attestation bundles were made for djlintr-0.5.12-py3-none-win_amd64.whl:

Publisher: pypi.yml on thraxil/djlintr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djlintr-0.5.12-py3-none-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for djlintr-0.5.12-py3-none-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f01df2887b94ba69671ecce8343cfa8779e41c80cdea62b1d2d7a66dcd43a380
MD5 353948a59ce55ac17b7afba2bd07da53
BLAKE2b-256 cdf0aa2b352ed6cfd185aa9189081cb1b17ec22770dd7642187e90f422c31879

See more details on using hashes here.

Provenance

The following attestation bundles were made for djlintr-0.5.12-py3-none-manylinux_2_34_x86_64.whl:

Publisher: pypi.yml on thraxil/djlintr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djlintr-0.5.12-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for djlintr-0.5.12-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bf4514752192f6d8a390104b081c80752e28e819e7c4f3cefeb592f0fcafeb8a
MD5 25ef6b1979dadbed2620096642750caf
BLAKE2b-256 40c36d44ae9e0288a9b7d80ca58a49ada2d51d07c8ab765ad46739fb29a0b263

See more details on using hashes here.

Provenance

The following attestation bundles were made for djlintr-0.5.12-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: pypi.yml on thraxil/djlintr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djlintr-0.5.12-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for djlintr-0.5.12-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5931247be3bb0f997fc73598847493508a8b6b87ce1f6a8ba6bbd6521a61c7fc
MD5 c20de4efc16b23348ffa40e68b193609
BLAKE2b-256 bdf9fe04d69c4beb787b6c2424bfa9ce27a23d009c4ca627096287ef8f352dde

See more details on using hashes here.

Provenance

The following attestation bundles were made for djlintr-0.5.12-py3-none-macosx_11_0_arm64.whl:

Publisher: pypi.yml on thraxil/djlintr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djlintr-0.5.12-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for djlintr-0.5.12-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a21ef1196e64ac8bed2a404746e7e3374866beb18d334653414b40b1f44b9f99
MD5 a9cc9ea9b8d899be108e3a8e1db06be5
BLAKE2b-256 1b74c8d5f399c9c860da4d6c98f7993e6ba8e1747c917b2f963ab70a86e5851c

See more details on using hashes here.

Provenance

The following attestation bundles were made for djlintr-0.5.12-py3-none-macosx_10_12_x86_64.whl:

Publisher: pypi.yml on thraxil/djlintr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page