Skip to content

Commit

Permalink
Rename NXF_ENABLE_STRICT_SYNTAX -> NXF_SYNTAX_PARSER(=v2)
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
bentsherman committed Feb 25, 2025
1 parent df99b11 commit 53565bc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
10 changes: 5 additions & 5 deletions docs/reference/env-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@ The following environment variables control the configuration of the Nextflow ru
:::
: Enable Nextflow *strict* execution mode (default: `false`)

`NXF_ENABLE_STRICT_SYNTAX`
: :::{versionadded} 25.02.0-edge
:::
: Enable the {ref}`strict syntax <updating-syntax-page>` for Nextflow config files.

`NXF_ENABLE_VIRTUAL_THREADS`
: :::{versionadded} 23.05.0-edge
:::
Expand Down Expand Up @@ -187,6 +182,11 @@ The following environment variables control the configuration of the Nextflow ru
:::
: Enable the use of Spack recipes defined by using the {ref}`process-spack` directive. (default: `false`).

`NXF_SYNTAX_PARSER`
: :::{versionadded} 25.02.0-edge
:::
: Set to `'v2'` to use the {ref}`strict syntax <updating-syntax-page>` for Nextflow config files (default: `'v1'`).

`NXF_TEMP`
: Directory where temporary files are stored

Expand Down
2 changes: 1 addition & 1 deletion docs/updating-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ The process `shell` section is deprecated. Use the `script` block instead. The V
### Configuration syntax

:::{versionadded} 25.02.0-edge
The strict config syntax can be enabled in Nextflow by setting `NXF_ENABLE_STRICT_SYNTAX=true`.
The strict config syntax can be enabled in Nextflow by setting `NXF_SYNTAX_PARSER=v2`.
:::

See {ref}`Configuration <config-syntax>` for a comprehensive description of the configuration language.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ import nextflow.config.parser.v2.ConfigParserV2
class ConfigParserFactory {

static ConfigParser create() {
final strict = SysEnv.get('NXF_ENABLE_STRICT_SYNTAX')=='true'
if( strict )
log.debug "Using strict config parser"
return strict
? new ConfigParserV2()
: new ConfigParserV1()
final parser = SysEnv.get('NXF_SYNTAX_PARSER', 'v1')
if( parser == 'v1' ) {
return new ConfigParserV1()
}
if( parser == 'v2' ) {
log.debug "Using config parser v2"
return new ConfigParserV2()
}
throw new IllegalStateException("Invalid NXF_SYNTAX_PARSER setting -- should be either 'v1' or 'v2'")
}

}
2 changes: 1 addition & 1 deletion validation/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fi
# Integration tests (strict syntax)
#
if [[ $TEST_MODE == 'test_strict' ]]; then
export NXF_ENABLE_STRICT_SYNTAX=true
export NXF_SYNTAX_PARSER=v2
test_integration
fi

Expand Down

0 comments on commit 53565bc

Please sign in to comment.