feat: add treefmt-nix to dev flake - #708
Conversation
3722901 to
7b66cf6
Compare
treefmt-nix to dev flake
|
@shivaraj-bh: Could you maybe run |
|
@gabyx Why use |
|
@shivaraj-bh : Cause running hooks and formatting are two orthogonal things. Running hooks is fine but having one global process which formats treewide (with caching) is something which is not super easy achievable with hooks. Running the format step (the exact same treefmt build and not again another nixfmt hook) in pre-commit is however the better option IMO. Treefmt is awesome btw :). Once used you will probably deploy it everywhere :) (We did so and its a game changer :)) |
I run
I agree. I use it in multiple projects. I don’t mind adding it here. |
@gabyx looks good. EDIT: or maybe just another commit in the same PR and then “Rebase and merge" |
1a697f7 to
38c8334
Compare
|
@srid: Last commit contains all changes for an inspection. |
38c8334 to
abde338
Compare
- Run `treefmt` directly. - Comment on `justfile`. Signed-off-by: Gabriel Nützi <gnuetzi@gmail.com>
abde338 to
2159bb7
Compare
|
Thanks @gabyx ! Let me know if it is good for me to take over. I will squash the existing commits into one; add a treewide format commit; run CI; Rebase and merge. |
|
@srid: Yes, its good, to take over, thanks a lot. |
|
@srid: maybe some precaution, maybe check the documentation is not destroyed, since markdown files are formatted, if yes -> let me know -> set a global ignore until the markdown is fixed. It looked good, but just saying. |
Things Done
Closes: #707
treefmtsetup indevflake to format treewide all files.nixpkgssincetreefmt-nixneeds a newer input.devwithnix flake checkruns the formatting check. (Should be integrated in omnix by default?)nixpkgs-fmtwithtreefmtonpre-commit..prettierrc.yamlin root (could be maybe somewhere else ...) to format all markdown files consistently.How it works:
just formatwill format all files: Once happy with the setup one can format the files onmainin one commit. Thedocsfolder with the markdown files look well treated by prettier and there is not much to change I guess.Note: When merging, one should apply
just formaton main directly afterwards aschore: formatting all files treewideAssisted-by: no agent.