Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formatter.nix & flake checks #31

Open
phaer opened this issue Aug 1, 2024 · 0 comments
Open

formatter.nix & flake checks #31

phaer opened this issue Aug 1, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@phaer
Copy link
Member

phaer commented Aug 1, 2024

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

@phaer phaer added documentation Improvements or additions to documentation enhancement New feature or request labels Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant