Format Rust, Nix and Bash via treefmt#47
Conversation
|
Can we add a .git-blame-ignore-revs which helps clean up |
|
Maintenance status of the repo is a little concerning. We might be able to get close to the same format with these options on https://github.com/mvdan/sh |
Ohh I looked at your shfmt suggestion, I thought it was https://github.com/patrickvane/shfmt, which when compared to beautysh looked more concerning. Didn't know that https://github.com/mvdan/sh provides shfmt nowadays, switching to that now!
Turns out at least the tabs vs spaces is nicely handled without extra config because it adheres to our .editorconfig. |
philiptaron
left a comment
There was a problem hiding this comment.
✅
treefmt-nix is pretty cool.
| lib.fileset.toSource { | ||
| root = ./.; | ||
| fileset = lib.fileset.gitTracked ./.; |
There was a problem hiding this comment.
Look at that dogfooding!
| # $ git config blame.ignoreRevsFile .git-blame-ignore-revs | ||
|
|
||
| # Reformatted all Nix files | ||
| 81d712a6c4e020bf545fb931b3106aff64871962 |
| 81d712a6c4e020bf545fb931b3106aff64871962 | ||
|
|
||
| # Reformatted all Bash scripts | ||
| b1306dd5ae96b0fb934256d91708733c1f850016 |
Prompted by #46 (comment) (cc @willbush). I didn't use a bash formatter, but https://github.com/lovesegfault/beautysh seems to almost match what I've been doing!
For Nix formatting we obviously use https://github.com/NixOS/nixfmt :)