-
-
Notifications
You must be signed in to change notification settings - Fork 669
Add ability to filter tasks by namespace on --list
and set a default filter
#2089
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
Comments
Hi @morganhein, I can see why this would be useful. Instead of introducing a new concept, I'd consider having some sort of filtering by namespace, with a setting to set the default. What do you think about it? task --list 'dev:*' version: '3'
default_filter: 'dev:*,docker:*' |
Yes, this would work as well. Anything to allow for visibility management of tasks in the default and power-user case would be great! Cheers! |
--list
and set a default filter
Andrey, I've been thinking about this proposal more, and wanted to share some additional considerations. This is just a thought exercise to explore alternatives. Maybe I should've thought this out completely beforehand, so that's on me. Either way here's a few thoughts: Regarding your proposal about not introducing a new concept - I think if we consider this from both the technical and user perspectives, things do change a bit. While technically we're not creating something like "groups" that affect visibility in the codebase, from a user perspective, this does change how namespaces function conceptually. Historically, namespaces served primarily as logical groups that affected display ordering (based on that logical group) during listing operations. With this change, namespaces would also function as "visibility groups" - essentially giving them dual purposes. This means users would likely need to prefix namespaces with their visibility category. Consider these two examples: Current Logical Grouping:
Proposed Visibility Grouping:
This visibility-first approach has several implications:
Thanks for considering! |
Really not a fan of adding things like this to the Taskfile schema. It feels more like configuration than anything to do with the actual tasks. I've actually had an overhaul of the output system in the back of my head for a while now. I believe that this should address the majority of your problems or easily be extended to do so. |
The |
Description
Howdy Task!
I know namespaces exist, and I use them heavily, but it's not enough for my use case.
I use Task heavily in a monorepo. It now contains tasks for:
This has been really great for having re-usable, composable steps that are also user-discoverable.
However even with things namespaced, the user experience for 1 is not great when all the other tasks exist. If I lean into usin Task further, I can imagine 100+ tasks, and that's just useless when listing as a developer.
So for me, being able to set "categories" of visibility (on top of namespaces), being able to default that only a specific namespace gets displayed, or something, would be great.
What i'm proposing is something like:
Then, when listing, allow me to do something like
task --group development
or something.For me, the real ask here is somehow hiding groups of tasks by default. I want Task to be the root/first place to look for all Tasks, regardless if it's a CI task or commonly used dev task. All tasks should be easily runnable by a user, without having to know which group/taskfile/etc it exists in. However for those that are just learning/discovering the code base, a simple
task --list
or analogous should present the user with the least amount of options possible, ideally with tasks that are more tailored to their experience.Using namespaces, this still spits out a list that overfills the terminal, and overwhelms the user.
Another way might be able to default a certain namespace as the only one visible?
so a
task --list
would, by default, only show thedev:
namespace, or something?Either way, thanks for the awesome tool!
The text was updated successfully, but these errors were encountered: