From 7a6681b776276c4f93968924eb5ec75f317a1e80 Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Fri, 26 Jul 2024 07:33:28 -0500 Subject: [PATCH] Deprecate module addParams() and params() Signed-off-by: Ben Sherman --- docs/module.md | 4 ++++ .../src/main/groovy/nextflow/script/IncludeDef.groovy | 2 ++ 2 files changed, 6 insertions(+) diff --git a/docs/module.md b/docs/module.md index 59fc886887..0bb7df1865 100644 --- a/docs/module.md +++ b/docs/module.md @@ -98,6 +98,10 @@ workflow { ## Module parameters +:::{deprecated} 24.07.0-edge +As a best practice, parameters should be used in the entry workflow and passed to functions / processes / workflows as explicit inputs. +::: + A module script can define parameters using the same syntax as a Nextflow workflow script: ```groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/script/IncludeDef.groovy b/modules/nextflow/src/main/groovy/nextflow/script/IncludeDef.groovy index 08e6e5566e..8c3548e4cb 100644 --- a/modules/nextflow/src/main/groovy/nextflow/script/IncludeDef.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/script/IncludeDef.groovy @@ -80,11 +80,13 @@ class IncludeDef { } IncludeDef params(Map args) { + log.warn "Include with `params()` is deprecated -- pass params as a workflow or process input instead" this.params = args != null ? new HashMap(args) : null return this } IncludeDef addParams(Map args) { + log.warn "Include with `addParams()` is deprecated -- pass params as a workflow or process input instead" this.addedParams = args return this }