How to include additional files from the task file? #146
Answered
by
nat-n
mgzenitech
asked this question in
Q&A
-
I'll try to write example here: [tool.poe]
include = ["poe_tasks/lint.toml"] poe_tasks/lint.toml # How to include poe_tasks/lint/dockerfile.toml from this file?
# [tool.poe]
# include = ["lint/dockerfile.toml"]
# Doesn't work here
[tool.poe.tasks.lint]
sequence = [
"lint:dockerfile"
]
ignore_fail = "return_non_zero" poe_tasks/lint/dockerfile.toml [tool.poe.tasks."lint:dockerfile"]
control.expr = "len(\"${file_path}\") > 0"
[[tool.poe.tasks."lint:dockerfile".args]]
name = "file_path"
options = ["--file", "-f"]
help = "Relative path to a Dockerfile"
[[tool.poe.tasks."lint:dockerfile".switch]]
case = "False"
shell = "hadolint */**/Dockerfile"
[[tool.poe.tasks."lint:dockerfile".switch]]
case = "True"
shell = "hadolint ${file_path}"
|
Beta Was this translation helpful? Give feedback.
Answered by
nat-n
May 7, 2023
Replies: 1 comment 3 replies
-
Hi @mgzenitech, I'm afraid today it is not possible to include task files from included task files. I think I did it this way because I wasn't sure if it was valuable, and it saved me from having to think about import loops. If you can present a compelling use case then maybe it can be considered as an enhancement. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's not how I Imagined this feature being used, but I see now that it would make sense to support this :). I've added it to my TODO list. I would also entertain a PR along these lines.