Skip to content

Conversation

@jfly
Copy link
Collaborator

@jfly jfly commented Nov 13, 2025

Full disclosure: the treefmt stdin spec is not yet finalized (see numtide/treefmt#586). However, nothing prevents us from implementing the version of it that I hope will be approved.

This completes #305.

I have very little haskell knowledge. I'm sure there are issues with this implementation. Be kind, I'm excited to learn more!

@github-actions
Copy link

github-actions bot commented Nov 13, 2025

Nixpkgs diff

toTargets Nixfmt{files = [], filename} = pure [stdioTarget filename]
toTargets Nixfmt{files = ["-"], filename} = pure [stdioTarget filename]
toTargets Nixfmt{files = [], stdin_filepath = Just filepath} = pure [stdioTarget filepath]
toTargets Nixfmt{files = _ : _, stdin_filepath = Just _} = error "Cannot specify both positional files and --stdin-filepath"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong to me. Should I instead change the return type of toTargets? Pointers appreciated.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/formatting-team-meeting-2025-11-11/72019/4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants