djls-pre-commit

July 25, 2026 ยท View on GitHub

pre-commit and prek hooks for django-language-server.

Usage

Add the hook to .pre-commit-config.yaml:

repos:
  - repo: https://github.com/joshuadavidthomas/djls-pre-commit
    rev: v6.0.3
    hooks:
      - id: djls-check

The hook installs the matching django-language-server release in its own environment and runs djls check on staged .html, .htm, and .djhtml files. Your Django project still needs a supported Python environment that django-language-server can discover.

Pass any djls check options through args:

hooks:
  - id: djls-check
    args: [--select, "S100,S117", --color, never]

Hook tags match django-language-server releases. Dependabot can keep the revision current:

# .github/dependabot.yml
version: 2
updates:
  - package-ecosystem: pre-commit
    directory: /
    schedule:
      interval: weekly

License

Licensed under the Apache License, Version 2.0. See LICENSE.