-
Notifications
You must be signed in to change notification settings - Fork 476
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
Add --fmt
subcommand
#837
Add --fmt
subcommand
#837
Conversation
Thanks for taking a crack at this:
What was the issue that you ran into? I think you could bound pub(crate) struct Recipe<'src, D: Display = Dependency<'src>> { You'll also need to add it to the impl blocks: impl<'src, D: Display> Recipe<'src, D> {
If there are no comments, shouldn't that avoid an empty
I'm not sure what I used to dislike tabs, but have actually come around to them, since tabs let everyone use a different tab-width. I'm inclined to keep them, and change |
Actually, for now, let's use spaces, just to keep the PR-size reasonable. We can adjust |
Fixed it, thanks! It turns out As for |
Let me know when this is ready to review. The main thing I'd like to see are a bunch of tests, probably for every construct, that the output of |
I think it's ready. Few random notes before review:
|
Awesome! I just ran CI, and I think the completion scripts are out of date.
I think that
Sounds good!
Also good, it definitely looks better this way.
Nice. We might eventually want to make |
Updated completions.
Yes, Recipe docstring comments are displayed in Please let me know what's the right way to handle those. |
Ah, right. That makes sense. I think we should change it so that |
Updated. Redirecting |
Awesome! Just pushed a commit fixing a small formatting diff. I'll check this out today or tomorrow. |
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.
This looks great! Some minor comments.
Fixed. Thanks for a review! |
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.
Looks good! A few minor things.
I think that adding |
Fixed, thanks! |
Hooookay! Sorry for the delay in reviewing this. I was in Miami for the Bitcoin conference. (Which was like a Bitcoin-themed circus, a bit superficial, but lots of fun.) I changed the help message text a little bit, refactored the format subcommand to make My concern with the doc comment handling was that doc comment might get "lost", i.e. never actually turned into an item. I changed it so that comments are always inserted into the I was going to say that this is ready to merge, but I thought of something looking over the code one last time. Comments that are on the same line as items aren't preserved. For example, this comment won't be preserved as an
Since this PR is already pretty large, I was thinking about merging this, and then adding an What do you think? |
Just thinking out loud: The method that swallows comments is |
Hi, thanks for fixes, they're really instructive (which is what I'm looking for - besides the fact that I'm using Just in all my projects and would love to pay back). Same line comments is something I've overlooked. Totally fine with |
You bet!
Awesome, I'll merge this now, and add an |
Merged! Thanks again for the initiative in tacking this! |
Implements #817.
Things I'd like to get feedback so I could fix them:
impl<'src> Display for UnresolvedRecipe<'src>
(cannot wrestle borrow checker)tree: (justfile ())
instead oftree: (justfile)
to pass tests (not sure that matters)--fmt
formats them to spaces, probably because it reuses space-based impl originally used for--dump
(I don't have any preference on the matter)