Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MarkusH/django-migrations-formatter
https://github.com/MarkusH/django-migrations-formatter
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/MarkusH/django-migrations-formatter
- Owner: MarkusH
- License: bsd-3-clause
- Created: 2021-03-25T22:01:56.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-05T23:33:37.000Z (6 months ago)
- Last Synced: 2024-10-06T04:19:50.232Z (4 months ago)
- Language: Python
- Size: 39.1 KB
- Stars: 30
- Watchers: 4
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- stars - MarkusH/django-migrations-formatter - (Python)
- stars - MarkusH/django-migrations-formatter - (Python)
README
# django-migrations-formatter
[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/MarkusH/django-migrations-formatter/Test%20&%20Deploy/main?style=for-the-badge)](https://github.com/MarkusH/django-migrations-formatter/actions?query=branch%3Amain+event%3Apush)
[![Codecov branch](https://img.shields.io/codecov/c/gh/MarkusH/django-migrations-formatter/main?style=for-the-badge)](https://app.codecov.io/gh/MarkusH/django-migrations-formatter/branch/main)
[![Version](https://img.shields.io/pypi/v/django-migrations-formatter?label=Version&style=for-the-badge)](https://pypi.org/project/django-migrations-formatter/)
![License](https://img.shields.io/pypi/l/django-migrations-formatter?style=for-the-badge)
![Python Versions](https://img.shields.io/pypi/pyversions/django-migrations-formatter?label=Python&style=for-the-badge)
![Django Versions](https://img.shields.io/pypi/djversions/django-migrations-formatter?color=%230C4B33&label=Django&style=for-the-badge)This Django library will format Django migrations using
[black](https://pypi.org/project/black/) and [isort](https://pypi.org/project/isort/).## Installation
Start by installing `django-migrations-formatter` from PyPI:
```console
(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. For ease of use, you can
install either of them by including them as "extras" during the installation.```console
(env)$ python -m pip install "django-migrations-formatter[black,isort]"
```Then you need to add `django_migrations_formatter.apps.MigrationsFormatter` to
your `INSTALLED_APPS`:```python
INSTALLED_APPS = [
...,
'django_migrations_formatter.apps.MigrationsFormatter',
]
```## Contributing
The project uses [black](https://pypi.org/project/black/) and
[isort](https://pypi.org/project/isort/) for formatting its code.
[flake8](https://pypi.org/project/flake8/) is used for linting. All these are
combined into [pre-commit](https://pre-commit.com/) to run before each commit
and push. To set it up:```console
(env)$ python -m pip install '.[black,dev,isort,test]'
(env)$ pre-commit install -t pre-commit -t pre-push --install-hooks
```To run the unit tests:
```console
(env)$ django-admin test --pythonpath . -v 2 --settings=tests.settings
```If you spot an problem, please [open an issue](https://github.com/MarkusH/django-migrations-formatter/issues/new)
on GitHub.