Skip to main content

A Django library to automatically format your migrations.

Project description

django-migrations-formatter

GitHub Workflow Status (branch) Codecov branch Version License Python Versions Django Versions

This Django library will format Django migrations using black and isort.

Installation

Start by installing django-migrations-formatter from PyPI:

(env)$ python -m pip install django-migrations-formatter

You will also need to make sure to have black and/or isort installed. Without them, this library doesn't provide any value.

Then you need to add django_migrations_formatter.apps.MigrationsFormatter to your INSTALLED_APPS:

INSTALLED_APPS = [
    ...,
    'django_migrations_formatter.apps.MigrationsFormatter',
]

Contributing

The project uses black and isort for formatting its code. flake8 is used for linting. All these are combined into pre-commit to run before each commit and push. To set it up:

(env)$ python -m pip install '.[dev,test]'
(env)$ pre-commit install -t pre-commit -t pre-push --install-hooks

To run the unit tests:

(env)$ django-admin.py test -v 2 --settings=tests.settings

If you spot an problem, please open an issue on GitHub.

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

django-migrations-formatter-0.1.4.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

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