Skip to main content

pre-commit-hooks-django

Some useful hooks for Django development

See also: https://github.com/pre-commit/pre-commit

Using pre-commit-hooks-django with pre-commit

Add this to your .pre-commit-config.yaml

-   repo: https://github.com/ecugol/pre-commit-hooks-django
    rev: v0.3.0  # Use the ref you want to point at
    hooks:
    -   id: check-untracked-migrations
        # Optional, if specified, hook will work only on these branches
        # otherwise it will work on all branches
        args: ["--branches", "main", "other_branch"]
    -   id: check-unapplied-migrations
    -   id: po-location-format
        # Mandatory, select one of the following options:
        # file: show only the file path as location
        # never: remove all locations
        args: ["--add-location", "file"]

Hooks available

check-untracked-migrations

Forbids commit if untracked migrations files are found (e.g. */migrations/0001_initial.py)

Options:
--branches

Optional, if specified, hook will work only on these branches
otherwise it will work on all branches

check-unapplied-migrations

WARNING: USE ONLY WITH DJANGO > v3.1

Check for unapplied migrations with manage.py migrate --check

po-location-format

Changes location format for .po files

Options:
--add-location [file, never]

Mandatory, select one of the following options:

file: show only the file path as location
never: remove all locations

Download files

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

Source Distribution

pre-commit-hooks-django-0.3.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

pre_commit_hooks_django-0.3.0-py2.py3-none-any.whl (5.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pre-commit-hooks-django-0.3.0.tar.gz.

File metadata

  • Download URL: pre-commit-hooks-django-0.3.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.5

File hashes

Hashes for pre-commit-hooks-django-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e722ba03ca4b20886ee41e06be3aff6930131c575ec86a43690730f032acaaee
MD5 10f732d229e27229bf87255726efe31c
BLAKE2b-256 f30a66e46c419841b42778dc120bd740ddf9d60221f3cede52a1e0fad575afae

See more details on using hashes here.

File details

Details for the file pre_commit_hooks_django-0.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pre_commit_hooks_django-0.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.5

File hashes

Hashes for pre_commit_hooks_django-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d195bd541030d3b2c8e98ff13076c280edc4b8bf46c22be6d188eda35d75a9e7
MD5 d144a5dedde9732228f0ad05fd73c812
BLAKE2b-256 bb4712c540bb626764332e7bd2982667a11bb0ad0856bad7baea73743e0b4631

See more details on using hashes here.

Supported by

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