Getting an odd linting error here - the linter app...
# linting
j
Getting an odd linting error here - the linter appears to imagine an extra output in one of the output tuples ("ap_ktab"):
Copy code
-- <http://main.nf|main.nf>
    output:
    tuple val(meta) , path("*${input_mat}.hap.ktab*", hidden: true), emit: mathap_ktab
    tuple val(meta2), path("*${input_pat}.hap.ktab*", hidden: true), emit: pathap_ktab
    path "versions.yml"                                            , emit: versions

-- linter error
Module meta.yml does not match <http://main.nf|main.nf>. Outputs should contain: {'mathap_ktab': ['meta', '${input_mat}.hap.ktab", hidden: true'], 'pathap_ktab': ['meta2', '${input_pat}.hap.ktab", hidden: true', 'ap_ktab'], 'versions': ['versions.yml']}
Is this a bug? https://github.com/nf-core/modules/pull/7847#issuecomment-2736500269
s
Does it pass linting if you remove the "hidden: true"?
Because I've never seen hidden: true in any other modules
a
I don't see an extra tuple listed in the expected outputs of that error message?
j
Dropping "hidden: true" from the meta.yml doesn't fix anything. Unfortunately it's needed in the module outputs as you need to emit
${prefix}.ktab
and
.${prefix}.ktab.1
@Arthur The linter says the expected output for the "pathap_ktab" is
pathap_ktab': ['meta2', '${input_pat}.hap.ktab", hidden: true', 'ap_ktab']
- there's an extra thing on the end there that shouldn't exist
a
Ok, I'm not sure where that extra bit is coming from, but there's a few inconsistencies in your meta.yml that you could try fixing first. • the output meta entries have a
pattern
which makes no sense • the output path entries have a trailing
"
but not a leading one, and it's not entirely obvious to me whether they should have the
hidden
part in the key like they do
j
The output pattern was generated when I ran
nf-core modules lint --fix
a
lol ok I worked out the issue
The way tools parses the outputs section, using a regex, if you have
path
(or
val/tuple
) in your emitted name, it breaks everything
🤣 1
j
oh my
a
There's not really a great fix for this I think. The required outputs are already ugly and borked because of
hidden
part too. Ideally we should rewrite nf-core linting to have a proper lexer and parser for the nextflow grammar such that we can better access the correct parts of the syntax. But it's possibly a lot of work and quite a bit slower than the current regex solution.
j
I'll rename the outputs to mat_hap_ktab and pat_hap_ktab for now - I presume that'll fix the regex issue
a
It should do yes
j
That's working now! Many thanks
s
Can you make it look for
path(
or
path
?
m
it’s related to this bug I think https://github.com/nf-core/tools/issues/3483
👍 1
fix on the way