[Django] #33761: Format migrations using black

186 views
Skip to first unread message

Django

unread,
Jun 1, 2022, 4:57:28 PM6/1/22
to django-...@googlegroups.com
#33761: Format migrations using black
-------------------------------------+-------------------------------------
Reporter: Neil | Owner: nobody
Panchal |
Type: New | Status: new
feature |
Component: | Version: dev
Migrations | Keywords: black, formatting,
Severity: Normal | migrations
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Now that Django has adopted black as the source code formatter, are there
any plans for formatting Django migrations with black?

Everytime I run `makemigrations`, I have to manually format them with
black. IMO, we should look at generating and formatting migrations using
black.

Thoughts?

--
Ticket URL: <https://code.djangoproject.com/ticket/33761>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 2, 2022, 12:14:41 AM6/2/22
to django-...@googlegroups.com
#33761: Format migrations using black
-------------------------------------+-------------------------------------
Reporter: Neil Panchal | Owner: nobody
Type: New feature | Status: closed
Component: Migrations | Version: dev
Severity: Normal | Resolution: invalid
Keywords: black, formatting, | Triage Stage:
migrations | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => invalid


Comment:

In Django 4.1+ migration files are formatted using the `black` command if
it is present on your `PATH`, see
[https://docs.djangoproject.com/en/dev/ref/django-admin/#black-formatting
docs].

--
Ticket URL: <https://code.djangoproject.com/ticket/33761#comment:1>

Reply all
Reply to author
Forward
0 new messages