Hacker News new | ask | show | jobs
by spocklivelong 2947 days ago
I just tried this on a Django project, and it formatted all the migration files as well. Is there a way to exclude certain directories when formatting a whole project?
2 comments

I'm working on that. In the mean time use your Unix fu with `find | grep | grep -v | xargs black`.
So what? How is that harmful?
I take it it's because the migration files are auto-generated anyway, so it's odd to auto-format previously auto-generated files. You also don't really want to have repository churn on those files since they're generated once (and then never edited again) along with the feature they're for.
It would be a one-time auto-format just like the one-time auto-format that black will do for the rest of the project. Any newly auto-generated files can be formatted before they are committed. So I don't see it actually adding to the harm.