Skip to content
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

Aliases to recipes in submodules #2629

Open
john-cd opened this issue Feb 11, 2025 · 3 comments
Open

Aliases to recipes in submodules #2629

john-cd opened this issue Feb 11, 2025 · 3 comments

Comments

@john-cd
Copy link

john-cd commented Feb 11, 2025

To "alias" a recipe in a module, I believe one has to call just again:

# Format all bin and lib files
f:
  @just code fmt

# Format all packages and their local path-based dependencies
fa:
  @just code fmtall

Could we have the following?

alias f  := code::fmt 
@casey
Copy link
Owner

casey commented Feb 11, 2025

Good suggestion! I added it to #2252.

I think this should be pretty easy to add, so added the good first issue label in case anyone wants to take a crack at it.

@corvusrabus
Copy link

Can I grab this one?

@casey
Copy link
Owner

casey commented Feb 17, 2025

Sure, go for it! Rough sketch of what I think will be needed:

  1. Add a ColonColon token kind, which will be used for path separators
  2. Add a Parser::parse_path function, which will parse a colon-separated path of names
  3. Change Parser::parse_alias to parse a path
  4. During analysis, verify that the path points to a valid recipe, and resolve the alias to that recipe.

4 is probably the trickiest, since this is the first time we've had to deal with inter-module dependencies.

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

No branches or pull requests

3 participants