Skip to main content

Some useful hooks for Django development

Project description

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

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

pre-commit-hooks-django-0.4.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

pre_commit_hooks_django-0.4.0-py2.py3-none-any.whl (5.1 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: pre-commit-hooks-django-0.4.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pre-commit-hooks-django-0.4.0.tar.gz
Algorithm Hash digest
SHA256 93dc4adae71f53115bf59eb918b05756558f0b7469109bcbbcfbffd78a822daf
MD5 b60b2ef16b6b1a11acfdde9c3c968614
BLAKE2b-256 8e4b147616a30cfbc8363eb6392449a04394921a81932d8b171a2bb723c7d323

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pre_commit_hooks_django-0.4.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using 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

File hashes

Hashes for pre_commit_hooks_django-0.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f7ab3de2720af928d53fdddc37a860679c255963b9e0fe95af9904abe9b02d8d
MD5 2399be60a0c04d0c52e02df9a298952a
BLAKE2b-256 5bfef59eeb1bd9522231caa6ab039e2b365d252ab933aeb9618687a85845c0db

See more details on using hashes here.

Supported by

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