#34085: Black shouldn't format non-Python files
-------------------------------------+-------------------------------------
Reporter: Jeff Triplett | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: 4.1
commands) |
Severity: Normal | Resolution:
Keywords: startproject black | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jeff Triplett):
> Django passes the written files to black (.png .txt files and so on, as
well as .py).
Right, that's the issue. If you run Black on the folder it will ignore
files that don't have a common `py*` extension.
If we pass a filename to Black to format the file then it will try to
format the file which seems to be the existing behavior. Unless we filter
out only known python extensions, I think your folder patch is the better
default behavior. Otherwise, Django is going to break a bunch of
requirements files for other projects and have other strange behavior for
file style that are just python enough that they can be reformatted.
--
Ticket URL: <https://code.djangoproject.com/ticket/34085#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070183cc8602f6-6014be8d-e6a4-4a54-85d9-64daf96b3e9f-000000%40eu-central-1.amazonses.com.