numtide / treefmt

one CLI to format your repo
https://treefmt.com
MIT License
534 stars 32 forks source link

git: format only files that changed #311

Open zimbatm opened 1 month ago

zimbatm commented 1 month ago

Is your feature request related to a problem? Please describe.

When introducing a "dirty" project to treefmt, it can create a lot of code churn as files that previously weren't formatted are now getting changed. You often end up with a fat commit that formats the whole repo and breaks git blame.

Describe the solution you'd like

When the file backend is git, only format the untrack and changed files by default.

Add a --all-files flag to override that default.

Describe alternatives you've considered

Additional context