Skip to content

How to derive a task from another and add additional arguments to it? #130

Answered by nat-n
johhnry asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @johhnry, thanks for the feedback :)

Personally I think that level of repetition between tasks is fine, but I'll humour the question.

There's no explicit inheritance mechanism for poe tasks, but you can get some degree of reuse with a ref task.

Firstly, your question made me realise ref tasks don't behave exactly as I had in mind, so I made this change which will be include in the 0.19.0 release soon. With that you'll be able to achieve what you want with the following:

[tool.poe.tasks]
lint-check = { cmd = "ruff check .", help = "Lint code" }
lint-fix   = { ref = "lint-check --fix", help = "Lint code and fix" }

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@johhnry
Comment options

Answer selected by johhnry
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