Opened 2 years ago

Last modified 2 years ago

#34085 closed Bug

Black shouldn't format non-Python files — at Version 1

Reported by: Jeff Triplett Owned by: nobody
Component: Core (Management commands) Version: 4.1
Severity: Release blocker Keywords: startproject black
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Jeff Triplett)

Oliver Andrich on Twitter told me that the requirements.in file in my startproject was adding spaces after being processed. After a bit more digging it appears that Black is being run against non-Python files like requirements.in, which is a common file pather used with pip-tools and pip-compile to create a locked requirements.txt. https://twitter.com/oliverandrich/status/1579872988891328513

Ideally, Black should not run on non-Python files <or> it'd be nice to have a better exclude option as Carlton pointed out. See: https://twitter.com/carltongibson/status/1579888108010868738

While I am a fan of Black, I personally think we should have some type of --skip-black or --skip-formatters because it's disruptive to have Black installed globally and have this be opt-in by default.

Change History (1)

comment:1 by Jeff Triplett, 2 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top