awslabs / linter-rules-for-nextflow

Linter rules for Nextflow DSL scripts
Apache License 2.0
28 stars 1 forks source link

ModuleIncludedTwiceRule is overzealous #23

Open jdidion opened 6 months ago

jdidion commented 6 months ago

I'm not sure I understand the rational here: https://github.com/awslabs/linter-rules-for-nextflow/pull/10:

Adds a rule that detects if a module is included twice with the same path even if an alias is used (redundant include).

There are cases where a process needs to be invoked twice in the same workflow. According to the nextflow documentation, the way to do this is with aliasing: https://www.nextflow.io/docs/latest/workflow.html#process-invocation

markjschreiber commented 6 months ago

including a module twice with and without an alias, doesn’t produce an error but Nextflow throws a confusing warning saying that the module is used twice.

include { TOOL } from 'my/path/tool/main'
include { TOOL as TOOL_2 } from 'my/path/tool/main'

The times I had seen this where where TOOL from one path was not the same as TOOL from another but during the copy pasting the name had been aliased but the path wasn't updated. It might be worth excluding it or lowering the severity.

If newer versions of Nextflow don't actually complain about this then that would also argue for the rule being deprecated.