-
Notifications
You must be signed in to change notification settings - Fork 484
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
Inline modules #2442
Comments
Thanks for opening this issue! I would like to eventually support inline modules, which would allow submodules to be defined in a single justfile. We could allow The syntax I've had in mind is:
But it could also be:
However, I do personally find indentation to be annoying and fiddly, so we could consider using
Or not, depending on preference:
|
I really like the
Feels really natural and easy to read. Nested indentation isn't awesome, but Either way sounds great to me! I love this idea. |
Yah, honestly I like it too, especially in terms of being easy to read. My preference for avoiding indentation-based syntax is mostly when it comes to writing and editing. For example, copy-pasting a recipe from an inline module, where it's indented, to a dedicated module file, where it won't be indented, would require fixing the indentation manually. But it's probably important that the syntax all feels consistent, and not randomly have |
I'd agree here! Looking forward to kicking the tires on this whenever it's implemented. Thanks for the excellent tool. |
Seconding. I was going to file this same issue. Is the intent for these to be just logical groupings or more like clap sub commands? I would lean more towards the subcmd option, though that is certainly more complicated:
|
They would be like subcommands, since an inline module is the same as a normal module, and normal modules create subcommands. It should be possible to nest modules recursively, although the parsing code will likely be horrible, so it's okay if only one level of nesting is supported at first. Every module can have its own default, like existing modules. Modules can't share anything yet, and are a little gimped at the moment 😅, see #2252. |
After tinkering around with an ever-growing Justfile, I'm going to put in my vote for:
|
Allowing For example, should this:
Be interpreted as recipe |
Ah I see, that makes sense. Any workarounds would make the syntax ugly. Another idea here is allowing dot-syntax. Mix does this and it works pretty well.
|
Yah, similar issues with |
Yup yup makes sense especially if you aim to expand the language and syntax over time. Love how thoughtful you've been with the tool! |
From this discord conversation.
I have a bunch of related tasks:
What I'd like to do is have a more clear separator (like rake):
This is possible with modules, but I cannot create multiple modules in a single Justfile (creating separate Justfiles would be messy in my case).
Two ideas I can think of to solve this problem:
:
,.
in the name grammar?The text was updated successfully, but these errors were encountered: