-
Hi, First of all, great project! I would like to have two different tasks:
Is there a better way to define those two tasks without having to do this? [tool.poe.tasks]
lint-check = { cmd = "ruff check .", help = "Lint code" }
lint-fix = { cmd = "ruff check . --fix", help = "Lint code and fix" } Like extending a previous task: lint-check = { cmd = "ruff check .", help = "Lint code" }
lint-fix = { extends = "lint-check", args = ["--fix"], help = "Lint code and fix" } Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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" } |
Beta Was this translation helpful? Give feedback.
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: