File tree 4 files changed +7
-16
lines changed
test/groovy/nextflow/config
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
24
24
import groovy.transform.CompileStatic
25
25
import groovy.transform.PackageScope
26
26
import groovy.util.logging.Slf4j
27
+ import nextflow.NF
27
28
import nextflow.config.ConfigBuilder
28
29
import nextflow.config.ConfigValidator
29
30
import nextflow.exception.AbortOperationException
@@ -117,7 +118,10 @@ class CmdConfig extends CmdBase {
117
118
final config = builder. buildConfigObject()
118
119
119
120
// -- validate config options
120
- new ConfigValidator (). validate(config)
121
+ if ( NF . getSyntaxParserVersion() == ' v2' ) {
122
+ Plugins . load(config)
123
+ new ConfigValidator (). validate(config)
124
+ }
121
125
122
126
// -- print config options
123
127
if ( printValue ) {
Original file line number Diff line number Diff line change @@ -340,7 +340,8 @@ class CmdRun extends CmdBase implements HubOptions {
340
340
Plugins . load(cfg)
341
341
342
342
// -- validate config options
343
- new ConfigValidator (). validate(config)
343
+ if ( NF . getSyntaxParserVersion() == ' v2' )
344
+ new ConfigValidator (). validate(config)
344
345
345
346
// -- create a new runner instance
346
347
final runner = new ScriptRunner (config)
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ package nextflow.config
18
18
19
19
import groovy.transform.CompileStatic
20
20
import groovy.util.logging.Slf4j
21
- import nextflow.NF
22
21
import nextflow.config.schema.ConfigScope
23
22
import nextflow.config.schema.SchemaNode
24
23
import nextflow.config.schema.ScopeName
@@ -74,14 +73,10 @@ class ConfigValidator {
74
73
}
75
74
76
75
void validate (ConfigMap config ) {
77
- if ( NF . getSyntaxParserVersion() != ' v2' )
78
- return
79
76
validate(config. toConfigObject())
80
77
}
81
78
82
79
void validate (ConfigObject config ) {
83
- if ( NF . getSyntaxParserVersion() != ' v2' )
84
- return
85
80
final flatConfig = config. flatten()
86
81
for ( String key : flatConfig. keySet() ) {
87
82
final names = key. tokenize(' .' )
Original file line number Diff line number Diff line change 16
16
17
17
package nextflow.config
18
18
19
- import nextflow.SysEnv
20
19
import org.junit.Rule
21
20
import spock.lang.Specification
22
21
import test.OutputCapture
@@ -29,14 +28,6 @@ class ConfigValidatorTest extends Specification {
29
28
@Rule
30
29
OutputCapture capture = new OutputCapture ()
31
30
32
- def setupSpec () {
33
- SysEnv . push(NXF_SYNTAX_PARSER : ' v2' )
34
- }
35
-
36
- def cleanupSpec () {
37
- SysEnv . pop()
38
- }
39
-
40
31
def ' should warn about invalid config options' () {
41
32
given :
42
33
def config = new ConfigMap ([
You can’t perform that action at this time.
0 commit comments