tools icon indicating copy to clipboard operation
tools copied to clipboard

Lint for incorrect `.mix(XXX.out.versions.first())` subworklow calls

Open jfy133 opened this issue 4 months ago • 6 comments

Description of feature

~It would be nice to have a linting check that every subworkflow and module called within a given script has their versions mixed into the ch_versions channel and sent downstream.~

~This would help developers to ensure they do not forget version reporting for all steps of the pipeline - something which is very important for nf-core pipelines in terms of reprdocubility etc.~

~I could envision this as picking up all the names in all the include calls (typically at the top of a workflow script), the nsearching for each name with a .out.versions suffix through that given script.~

~If e.g. FOO.out.versions then you get a lint warning to ensure versions are reported for that module/subworkflow.~

Furthermore, an additional check could be made so that for subworkflows that the string does not include .first() at the end as we do for modules - subworkflows should have N > 1 modules, thus you don't want to pick just the first entry of all of those modules.

(EDIT I didn't realise there was a lint check for the first suggestion, I guess because I never forget to mix my versions 😎)

jfy133 avatar Aug 15 '25 13:08 jfy133

Note this may become redundant with topic channels, but I think this would be a nice small workaround for teh time being

jfy133 avatar Aug 15 '25 13:08 jfy133

there is a linting test for that, check the warning in subworkflows

maxulysse avatar Aug 15 '25 13:08 maxulysse

that's why I started https://github.com/nf-core/sarek/pull/1955

maxulysse avatar Aug 15 '25 13:08 maxulysse

Is there?! Ok maybe I tested on the wrong pipeline 😅 (mag has a huge number of warnings so maybe I missed it)

Does it have the subworklow/module nuance though?

jfy133 avatar Aug 15 '25 14:08 jfy133

Because I guess in my case all my modules/subworklow did have version mixing calls - but they weren't getting to the end user

jfy133 avatar Aug 15 '25 14:08 jfy133

Updated accordingly

jfy133 avatar Aug 15 '25 14:08 jfy133