Opened 3 years ago
Last modified 3 years ago
#34085 closed Bug
Black shouldn't format non-Python files — at Initial Version
| 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
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