File tree Expand file tree Collapse file tree 4 files changed +7
-16
lines changed
test/groovy/nextflow/config Expand file tree Collapse file tree 4 files changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import com.beust.jcommander.Parameters
2424import groovy.transform.CompileStatic
2525import groovy.transform.PackageScope
2626import groovy.util.logging.Slf4j
27+ import nextflow.NF
2728import nextflow.config.ConfigBuilder
2829import nextflow.config.ConfigValidator
2930import nextflow.exception.AbortOperationException
@@ -117,7 +118,10 @@ class CmdConfig extends CmdBase {
117118 final config = builder. buildConfigObject()
118119
119120 // -- validate config options
120- new ConfigValidator (). validate(config)
121+ if ( NF . getSyntaxParserVersion() == ' v2' ) {
122+ Plugins . load(config)
123+ new ConfigValidator (). validate(config)
124+ }
121125
122126 // -- print config options
123127 if ( printValue ) {
Original file line number Diff line number Diff line change @@ -340,7 +340,8 @@ class CmdRun extends CmdBase implements HubOptions {
340340 Plugins . load(cfg)
341341
342342 // -- validate config options
343- new ConfigValidator (). validate(config)
343+ if ( NF . getSyntaxParserVersion() == ' v2' )
344+ new ConfigValidator (). validate(config)
344345
345346 // -- create a new runner instance
346347 final runner = new ScriptRunner (config)
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ package nextflow.config
1818
1919import groovy.transform.CompileStatic
2020import groovy.util.logging.Slf4j
21- import nextflow.NF
2221import nextflow.config.schema.ConfigScope
2322import nextflow.config.schema.SchemaNode
2423import nextflow.config.schema.ScopeName
@@ -74,14 +73,10 @@ class ConfigValidator {
7473 }
7574
7675 void validate (ConfigMap config ) {
77- if ( NF . getSyntaxParserVersion() != ' v2' )
78- return
7976 validate(config. toConfigObject())
8077 }
8178
8279 void validate (ConfigObject config ) {
83- if ( NF . getSyntaxParserVersion() != ' v2' )
84- return
8580 final flatConfig = config. flatten()
8681 for ( String key : flatConfig. keySet() ) {
8782 final names = key. tokenize(' .' )
Original file line number Diff line number Diff line change 1616
1717package nextflow.config
1818
19- import nextflow.SysEnv
2019import org.junit.Rule
2120import spock.lang.Specification
2221import test.OutputCapture
@@ -29,14 +28,6 @@ class ConfigValidatorTest extends Specification {
2928 @Rule
3029 OutputCapture capture = new OutputCapture ()
3130
32- def setupSpec () {
33- SysEnv . push(NXF_SYNTAX_PARSER : ' v2' )
34- }
35-
36- def cleanupSpec () {
37- SysEnv . pop()
38- }
39-
4031 def ' should warn about invalid config options' () {
4132 given :
4233 def config = new ConfigMap ([
You can’t perform that action at this time.
0 commit comments