Skip to content
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

Add ability for tasks to refuse composition. #46

Open
jimsynz opened this issue Jul 15, 2024 · 1 comment
Open

Add ability for tasks to refuse composition. #46

jimsynz opened this issue Jul 15, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@jimsynz
Copy link

jimsynz commented Jul 15, 2024

As much as we really really want to discourage this use case, there may be times that a task should not be used from within another task - eg those that rely on the compiled project for introspection.

This issue is to track discussion on how to best support these use cases and minimise the potential pitfalls of doing so.

@jimsynz jimsynz added the enhancement New feature or request label Jul 15, 2024
@zachdaniel
Copy link
Contributor

This is @jimsynz idea, not mine:

First, we add a requires_compile?: false flag to Igniter.Mix.Task.Info. Then, when calling Igniter.composing tasks, if we're composing a task with requires_compile?: falseand there are any staged changes in the igniter, we show the user a diff & commit prompt w/ a message liketask foo.bar must write all changes and compile before proceeding(must will be in red). If they accept this, then we write everything and do aMix.Task.run("compile")` and continue on as normal.

@zachdaniel zachdaniel added the good first issue Good for newcomers label Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Development

No branches or pull requests

2 participants