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.4.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: check-absent-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

check-absent-migrations

Check for absent migrations with manage.py makemigrations --check --dry-run

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

Metadata

Release files for pre-commit-hooks-django 0.4.0

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

Source distribution (sdist)

Source distribution for pre-commit-hooks-django 0.4.0
File Size Uploaded
pre-commit-hooks-django-0.4.0.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pre-commit-hooks-django 0.4.0
File Interpreter ABI Platform
pre_commit_hooks_django-0.4.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 9.0 kB

Release files / pre-commit-hooks-django-0.4.0.tar.gz

Download URL pre-commit-hooks-django-0.4.0.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
93dc4adae71f53115bf59eb918b05756558f0b7469109bcbbcfbffd78a822daf
BLAKE2b-256 checksum
How to use checksums
8e4b147616a30cfbc8363eb6392449a04394921a81932d8b171a2bb723c7d323
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / pre_commit_hooks_django-0.4.0-py2.py3-none-any.whl

Download URL pre_commit_hooks_django-0.4.0-py2.py3-none-any.whl
Size 5.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
f7ab3de2720af928d53fdddc37a860679c255963b9e0fe95af9904abe9b02d8d
BLAKE2b-256 checksum
How to use checksums
5bfef59eeb1bd9522231caa6ab039e2b365d252ab933aeb9618687a85845c0db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.1

1 release file

0.2.0

2 release files

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