Skip to content

feat: simplify depends-on writing #3979

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

Conversation

ruben-arts
Copy link
Contributor

@prsabahrami previously added the ability to directly write a task as depends on. But only using the mapped versions.
I've walked into confusion multiple times now mixing the normal task an the depends on task.

This should simplify it:

[tasks]
# Simple task
simple = "echo simple"
# Map style
map = { cmd = "echo map", depends-on = ["simple"]}
# Normal depends-on
depends-on = { depends-on = ["map"]}
# Simple depends-on full map
depends-on-new = [{task = "map", environment = "x"}]
# Extra simple depends-on <<<<<< THIS WAS ADDED IN THIS PR
super-simple-depends-on = ["map", "simple"]

I've added a simple test to test this feature in deserialization.

@ruben-arts
Copy link
Contributor Author

Sorry for the commit msg, that was a mistake.

@ruben-arts ruben-arts marked this pull request as ready for review June 19, 2025 18:14
@ruben-arts ruben-arts marked this pull request as draft June 24, 2025 07:24
@ruben-arts
Copy link
Contributor Author

I realize this PR might make the written tasks a bit less clear when reading, as the cmd supports arrays for commands too.

e.g.:

[tasks]
# one == two
one = { cmd = ["echo", "hello", "world"] }
two = "echo hello world"

# x == y == z
x = { depends-on = ["one", "two"] }
y = ["one", "two"]
z = [{task = "one"}, {task = "two"}]

What do you think @Hofer-Julian?

Copy link
Contributor

@lucascolley lucascolley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also worry that this is unclear, y = ["one", "two"] is not unreasonably interpreted as y = { cmd = ["one", "two"] }.

@Hofer-Julian
Copy link
Contributor

I also worry that this is unclear, y = ["one", "two"] is not unreasonably interpreted as y = { cmd = ["one", "two"] }.

Agreed!

@ruben-arts
Copy link
Contributor Author

Then I'll close it.

@ruben-arts ruben-arts closed this Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants