File tree Expand file tree Collapse file tree 5 files changed +36
-5
lines changed Expand file tree Collapse file tree 5 files changed +36
-5
lines changed Original file line number Diff line number Diff line change 1
1
# nextflow-io/nf-schema: Changelog
2
2
3
- # Version 2.3.0
3
+ # Version 2.2.1
4
4
5
5
## Bug fixes
6
6
7
7
1 . Fixed a bug in ` paramsSummaryMap() ` related to the processing of workflow config files.
8
+ 2 . Fixed a bug where ` validation.defaultIgnoreParams ` and ` validation.ignoreParams ` would not actually ignore the parameter validation.
8
9
9
10
# Version 2.2.0 - Kitakata
10
11
Original file line number Diff line number Diff line change @@ -330,8 +330,12 @@ class SchemaValidator extends PluginExtensionPoint {
330
330
// Validate
331
331
List<String > validationErrors = validator. validate(paramsJSON, schema_string)
332
332
this . errors. addAll(validationErrors)
333
- if (this . hasErrors()) {
334
- def msg = " ${ colors.red} The following invalid input values have been detected:\n\n " + errors. join(' \n ' ). trim() + " \n ${ colors.reset} \n "
333
+ def List<String > modifiedIgnoreParams = config. ignoreParams. collect { param -> " * --${ param} " as String }
334
+ def List<String > filteredErrors = errors. findAll { error ->
335
+ return modifiedIgnoreParams. find { param -> error. startsWith(param) } == null
336
+ }
337
+ if (filteredErrors. size() > 0 ) {
338
+ def msg = " ${ colors.red} The following invalid input values have been detected:\n\n " + filteredErrors. join(' \n ' ). trim() + " \n ${ colors.reset} \n "
335
339
log. error(" Validation of pipeline parameters failed!" )
336
340
throw new SchemaValidationException (msg, this . getErrors())
337
341
}
Original file line number Diff line number Diff line change @@ -52,6 +52,5 @@ class ValidationConfig {
52
52
}
53
53
ignoreParams + = config. defaultIgnoreParams ?: []
54
54
ignoreParams + = ' nf_test_output' // ignore `nf_test_output` directory when using nf-test
55
-
56
55
}
57
56
}
Original file line number Diff line number Diff line change 1
1
Manifest-Version : 1.0
2
2
Plugin-Id : nf-schema
3
- Plugin-Version : 2.2.0
3
+ Plugin-Version : 2.2.1
4
4
Plugin-Class : nextflow.validation.ValidationPlugin
5
5
Plugin-Provider : nextflow
6
6
Plugin-Requires : >=23.10.0
Original file line number Diff line number Diff line change @@ -483,6 +483,33 @@ class ValidateParametersTest extends Dsl2Spec{
483
483
! stdout
484
484
}
485
485
486
+ def ' should ignore wrong expected params' () {
487
+ given :
488
+ def schema = Path . of(' src/testResources/nextflow_schema.json' ). toAbsolutePath(). toString()
489
+ def SCRIPT = """
490
+ params.input = 1
491
+ params.outdir = 2
492
+ include { validateParameters } from 'plugin/nf-schema'
493
+
494
+ validateParameters(parameters_schema: '$schema ')
495
+ """
496
+
497
+ when :
498
+ def config = [" validation" : [
499
+ " ignoreParams" : [' input' ],
500
+ " defaultIgnoreParams" : [' outdir' ]
501
+ ]]
502
+ def result = new MockScriptRunner (config). setScript(SCRIPT ). execute()
503
+ def stdout = capture
504
+ .toString()
505
+ .readLines()
506
+ .findResults {it. contains(' WARN nextflow.validation.SchemaValidator' ) || it. startsWith(' * --' ) ? it : null }
507
+
508
+ then :
509
+ noExceptionThrown()
510
+ ! stdout
511
+ }
512
+
486
513
def ' should fail for unexpected param' () {
487
514
given :
488
515
def schema = Path . of(' src/testResources/nextflow_schema.json' ). toAbsolutePath(). toString()
You can’t perform that action at this time.
0 commit comments