Skip to content

How to execute a task in all members + workspace root? #521

Answered by augustocdias
augustocdias asked this question in Q&A
Discussion options

You must be logged in to vote

I came up with the following that works, but I'm 100% unsatisfied with... It is too verbose.

[env]
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true

[tasks.lint]
dependencies = ["lint-root", "lint-members"]
workspace = false

[tasks.lint-base]
script = '''
cargo fmt -- --emit=files
cargo clippy -- -D warnings
'''

[tasks.lint-members]
run_task = { name = "lint-base", fork = true }

[tasks.lint-root]
run_task = { name = "lint-base" }
workspace = false

If there's a better way to do it please share. Otherwise I suggest to open an issue to make it easier to express this in a simpler way.

It is interesting that the "default" tasks behaves as expected without any change:

[tasks.test]
command = "cargo"

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@sagiegurari
Comment options

@sagiegurari
Comment options

@augustocdias
Comment options

@sagiegurari
Comment options

@augustocdias
Comment options

Answer selected by augustocdias
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants