Skip to content

The full list of taskfile paths that has been evaluated should be visible in task --list-all --json #2396

@adamscybot

Description

@adamscybot

Description

It's likely an unspoken but commonplace expectation that taskfiles will only includes other taskfiles that are within the scope of a project directory structure.

Possibly this could turn into a discussion about being able to provide some kind of additional flag to go alongside --dir <path>, or an alternative to it, to enforce this at runtime like --no-parent-includes. But I see this issue as a lower-hanging fruit that enables those who want to go out of their way to enforce a check against unexpected inclusion outside of a project with minimal effort.

One such use case where you really want this is for orchestrating task over untrusted projects, like vscode extensions. I am currently building a task extension for VSCode that is based on the VSCode TaskProvider API. In these cases, it would be nice to warn the user that a project is about to do this.

It also enables such locations to be watched via fs notifications.

If task --list-all --json had a property at the root level (since some included taskfiles may not have any tasks, but the fact it was included remains relevant) which would be an array of all the included paths encountered during task list evaluation, then there would at least be a way to validate this.

It probably has some debug use cases as well as a bonus, especially if constructing paths using template vars.

Metadata

Metadata

Assignees

Labels

area: includesChanges related to included taskfiles.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions