numtide / treefmt-nix

treefmt nix configuration
https://numtide.github.io/treefmt/
MIT License
247 stars 75 forks source link

`flake-parts`: Remove top-level 'treefmt' package #28

Closed srid closed 1 year ago

srid commented 1 year ago

See https://github.com/numtide/treefmt-nix/pull/14#issuecomment-1365944045

This effectively reverts #18

marijanp commented 1 year ago

I don't agree with the argument that it is intrusive to have the wrapped formatter available. I'm subscribing to the formatter-check anyways and therefore I want to have an easy way to access and run the formatter. now I have to duplicate the same code everywhere whether it be adding it to a devshell or as a flake output. in the first case requiring me to enter the devshell, if I don't use direnv, just to quickly run the formatter because the CI job failed.

srid commented 1 year ago

Some users dislike it, some users want it. We can make it an option so you only have to enable it rather than wire it all yourself, cf. autoWire = true; of https://github.com/srid/haskell-flake/issues/62

zimbatm commented 1 year ago

The new default is that it inserts itself as the default formatter invoked by nix fmt. And you can turn it off by setting flakeFormatter = false;. I think that's enough isn't it?

Kranzes commented 1 year ago

I much prefer it the way @zimbatm just explained.