Skip to content

Include multiple task files, while file remain in the included tasks directory #2878

@danon

Description

@danon

Description

Taskfile is great! I split my task files into multiple tasks, and they behave like a namespace. I have multiple modules in my application, and one root taskfile. I want to call certain tasks per module, and in the root file, I want to call them anyway, kinda like a namespace.

module/
  taskfile.yaml
taskfile.yaml

In i can call:

task module:do-something

Or from the module I can

cd module/
task do-something

The problem is, with current taskfile syntax, when I include those files, I need to pass in the path of the file twice, once as a taskfile, and once as a dir:

include:
  taskfile: module/
  dir: module/

It's very tedious, redundant, and it's error-prone. It happened to me multiple times that by mistake I typed in incorrect path for the taskfile and dir.

It would be awesome, if there was another key word like include, maybe we can name it namespace, that allows to inlucde the taskfile with the dir that's already in that taskfile. It would help be greatly. Here's a screenshort from my actual project, and what it would look like:

Image

You can see it greatly increases readability, and makes it less error-prone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: needs triageWaiting to be triaged by a maintainer.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions