Is your feature request related to a problem? Please describe.
I love simply adding a formatter nix to invoke treefmt-nix by just adding a treefmt-nix.mkWrapper call as e.g. in nixos-facter.
But I'd like to use the same treefmt-nix configuration as a flake check. As afaik there's no generic interface to tell a given formatter to enter "check mode", I believe we can't add such a feature to blueprint automatically.
Describe the solution you'd like
Not sure, hence this issue: I one thing could be to make the treefmt-nix wrapper expose passthru.check or so which would enable something like checks.format = perSystem.formatter.passthru.check in a quite generic way.
Describe alternatives you've considered
Maybe adapting formatter.nix to be able to return formatter and some checks? This would allow just using treefmt-nix.lib.evalModule and then treefmt.config.build.wrapper, treefmt.config.build.check, ... as needed.
Additional context
The former would of course affect treefmt-nix, happy to create a PR there, just wanted to collect feedback here as i ran into this with blueprint specifically
Is your feature request related to a problem? Please describe.
I love simply adding a formatter nix to invoke treefmt-nix by just adding a treefmt-nix.mkWrapper call as e.g. in nixos-facter.
But I'd like to use the same treefmt-nix configuration as a flake check. As afaik there's no generic interface to tell a given formatter to enter "check mode", I believe we can't add such a feature to blueprint automatically.
Describe the solution you'd like
Not sure, hence this issue: I one thing could be to make the treefmt-nix wrapper expose
passthru.check
or so which would enable something likechecks.format = perSystem.formatter.passthru.check
in a quite generic way.Describe alternatives you've considered
Maybe adapting formatter.nix to be able to return
formatter
and somechecks
? This would allow just usingtreefmt-nix.lib.evalModule
and thentreefmt.config.build.wrapper
,treefmt.config.build.check
, ... as needed.Additional context
The former would of course affect treefmt-nix, happy to create a PR there, just wanted to collect feedback here as i ran into this with blueprint specifically