Ordering of tasks from main Justfile and from imports.
Originally posted by gl-yziquel May 26, 2024 Hi.
I've got a use case that seems to go counter to current Just behavious, and, as suggested on a bug report discussion, I (or we) would welcome user feedback. So please share your thoughts.
Original bug report: https://github.com/casey/just/issues/2076
I want to be able to control the listing of tasks, with just --list --unsorted. And would like to be able to do the following:
import "task1.just"
task2:
echo Task 2
import "task3.just"
task3:
echo Task 4
[private]
@help:
just --list --unsorted --justfile "{{ justfile() }}"
I would like the output of just help to be as follows:
Available recipes:
task1
task2
task3
task4
That would allow me to control precisely the ordering of the display of just recipes.
Currently, the behaviour of Just is to render the recipes of the current Justfile first, and the imports later. Like that
Available recipes:
task1
task3
task2
task4
As my use case would require a "breaking" change of current behaviour, user feedback would be appreciated.
@gl-yziquel converted this to an issue, since I tend to lose track of discussions.
I definitely like the idea that import "justfile" behaves as much as possible as if you had taken the contents of the imported justfile and pasted them into the current file at exactly the line where the import appears. That would imply that just should list recipes in the first rather than the second order.
@neunenak Thank you.
@casey I believe this issue may now be closed. No ?
Yah, I think this was implemented. Thanks for the ping!
I just tried this with just 1.40.0, and this issue, if it ever was solved (I beieve it was), has crept back.
I'd like to reopen it.