Skip to content

Commit 0216b86

Browse files
committed
fix edge case in new implementation
1 parent 4799dac commit 0216b86

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/main/groovy/nextflow/validation/parameters/ParameterValidator.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,11 @@ class ParameterValidator {
150150
// Check for nextflow core params and unexpected params
151151
//=====================================================================//
152152
unevaluatedParams.each{ param ->
153+
def String dotParam = param.replaceAll("/", ".")
153154
if (NF_OPTIONS.contains(param)) {
154155
errors << "You used a core Nextflow option with two hyphens: '--${param}'. Please resubmit with '-${param}'".toString()
155156
}
156-
else if (!config.ignoreParams.any { param.startsWith(it) } ) {
157+
else if (!config.ignoreParams.any { dotParam == it || dotParam.startsWith(it + ".") } ) { // Check if an ignore param is present
157158
def String text = "* --${param.replaceAll("/", ".")}: ${getValueFromJsonPointer("/"+param, paramsJSON)}".toString()
158159
if(config.failUnrecognisedParams) {
159160
errors << text

src/test/groovy/nextflow/validation/ValidateParametersTest.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,7 @@ class ValidateParametersTest extends Dsl2Spec{
14431443
params.genome = [
14441444
"test": "test"
14451445
]
1446+
params.genomebutlonger = true
14461447
params.testing = "test"
14471448
include { validateParameters } from 'plugin/nf-schema'
14481449
@@ -1461,6 +1462,6 @@ class ValidateParametersTest extends Dsl2Spec{
14611462

14621463
then:
14631464
noExceptionThrown()
1464-
stdout == ["* --testing: test"]
1465+
stdout == ["* --testing: test", "* --genomebutlonger: true"]
14651466
}
14661467
}

0 commit comments

Comments
 (0)