fix(mbake): correct mbake command and use stdin#798
Merged
stevearc merged 4 commits intostevearc:masterfrom Nov 3, 2025
Saul-CD:fix-mbake
Merged
fix(mbake): correct mbake command and use stdin#798stevearc merged 4 commits intostevearc:masterfrom Saul-CD:fix-mbake
stevearc merged 4 commits intostevearc:masterfrom
Saul-CD:fix-mbake
Conversation
stevearc
requested changes
Nov 2, 2025
Owner
stevearc
left a comment
There was a problem hiding this comment.
Thanks for the PR! I just merged #796 which makes the same change from bake -> mbake, but I'm happy to take a change to use stdin/stdout as well. I'd prefer to keep this in the same formatter rather than creating two. Could you merge your changes into the existing bake formatter?
Owner
|
LGTM thanks! |
Contributor
Author
|
Thanks so much for the feedback and for taking the time to review my PR. I'm happy to make that change. I updated my branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed that the existing bake formatter was not working correctly after installing it with mason.nvim, and after some investigation, I found two main issues and fixed them in a new file mbake.lua.
I chose to create a new mbake.lua file and set its command = "mbake" instead of modifying the existing bake.lua because thats the name it has in pypi, mason, and its the current default (and i think only) name of the executable: EbodShojaei/bake@f4b1c9f EbodShojaei/bake@e60dec1
Having a formatter named mbake will be more intuitive i think.
Also, the previous approach (stdin = false and passing $FILENAME as an argument) caused the formatter to fail: mbake would correctly format the temporary file created by conform.nvim, but since it formats the file in-place, it doesn't return any output to stdout, which was interpreted as a failure and the (correctly formatted) temporary file was deleted, leaving the original buffer untouched.
This fix uses the --stdin flag, which was specifically added to mbake for editor integrations like this one. EbodShojaei/bake@0cd0cbd
Finally, I'd like to mention that this is my first pull request to an open-source project. I'm incredibly excited to contribute, but I'm also aware that I might not have followed all the project's conventions perfectly.
I am completely open to any feedback, suggestions, or requested changes. Please let me know if there's anything I can do to improve this PR or future contributions!