list: show fallback recipes when fallback is enabled#3097
list: show fallback recipes when fallback is enabled#3097veeceey wants to merge 1 commit intocasey:masterfrom
Conversation
dc96bd9 to
3a2d42d
Compare
|
just a gentle nudge on this when you have a moment! |
When `set fallback` is active and `just --list` is run, the output now also includes recipes from parent justfiles, displayed under a "Fallback recipes from <path>" heading. This walks up the directory tree, loading each parent justfile until one without fallback is found. Fixes casey#1500
3a2d42d to
0bbc51c
Compare
casey
left a comment
There was a problem hiding this comment.
Thanks for the PR!
The fallback logic is complex enough that I don't want to duplicate it. It should be shared between list and run.
Also, not all recipes in parent justfiles are runnable.In particular, if you have a recipe foo in the justfile in the current directory, and a recipe foo in a fallback justfile in the parent directory, the parent foo is not runnable, since just foo will run foo in the current directory, so it should be filtered.
|
I've had a stab at implementing the shared logic, covering casey's suggestions and the other features noted in #1500 You can see the diff here: cbrown1234#1 I don't seem to be able to raise PR's to the project, even though the contributing section of the README seems to indicate I should, maybe things have changed and that's not been updated yet? |
|
@cbrown1234 Sorry about that! PRs are currently closed. See #3227. I just added a note to the top of the contributing section of the readme in #3289. |
When
set fallbackis active,just --listnow walks up the directory tree and also displays recipes from parent justfiles. Each parent's recipes appear under a clearly labeled heading:It keeps walking as long as each parent also has
set fallbackenabled, and respects the same search config constraints as the run fallback logic (only works with directory-based search, not--justfile).Changes:
Searchnow derivesCloneso we can iterate parent directorieslist()takesloaderandsearchparameters to compile parent justfilesManual test results:
All existing fallback (14) and list (45) tests pass.
Fixes #1500