Hi everyone, I just noticed something that might b...
# team-maintainers
n
Hi everyone, I just noticed something that might be useful for modules. You can set the defaults of
ext
directives in the module itself (like
ext prefix: "${meta.id}", args: ''
for example) and I think it could be useful to set the defaults there instead of setting it twice (one time in the script block and one time in stub block). What do you guys think about this?
s
show me an example
j
show me what you got
🤣 1
n
On it! I'll make a POC PR 😛
shared a GIF
s
this also makes the args directly available in the module
n
yep 😛 nothing changes as you can see by the passing tests
I'm also adding another example because I noticed
samtools/sort
actually has a prefix in the test config
s
nice trick
n
Going on a deep dive in the documentation tends to result in some nice tricks 😁
party this 1
s
though I can see a downside of having args in the module....it will break resume if args are declared in the module
am i right ?
n
How so? This only declares the defaults so nothing really changes except that the ext variable exists from the start instead of hardcoding in the defaults in the execution blocks
s
ah placeholders ok
n
yes it's basically like
def prefix = task.ext.prefix ?: "${meta.id}"
but more consolidated