-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Implement --mergetool mode #283
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/formatting-team-meeting-2025-02-18/60511/1 |
6a2c935
to
ac278e7
Compare
This is now done, please review :) |
main/Main.hs
Outdated
mergeToolJob :: Nixfmt -> IO Result | ||
mergeToolJob opts@Nixfmt{files = [base, local, remote, merged]} = runExceptT $ do | ||
let formatter = toFormatter opts | ||
joinEithers :: [Either String ()] -> Either String () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why Either String ()
and not Maybe String
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the return type of formatTarget
, I guess using the typealias Result
would make in clearer. Edit: Done that
Makes resolving formatting-related conflicts easier. Idea and docs are from @oxij's #277. Code and tests are from @infinisil. By implementing it in Haskell, it's faster (less process spawning) and trivially integrated into build and distribution. Co-Authored-By: Jan Malakhovski <oxij@oxij.org>
ac278e7
to
8439892
Compare
Inspired by @oxij's #277, but implemented in Haskell, therefore faster (less process spawning) and trivially integrated into the build and distribution.
Things done:
This work is funded by Antithesis and Tweag ✨