diff --git a/adr/20251017-typed-processes.md b/adr/20251017-typed-processes.md index 24fe99ec91..bbc9e9c24f 100644 --- a/adr/20251017-typed-processes.md +++ b/adr/20251017-typed-processes.md @@ -245,7 +245,7 @@ Moving topic emissions to a dedicated section allows them to be defined without ## Distinguishing between typed and legacy processes -Typed processes are gated behind the `nextflow.preview.types` feature flag. This flag will be replaced by `nextflow.enable.types` when the feature becomes stable, which will be used to distinguish between typed and legacy processes in the language. +Typed processes are gated behind the `nextflow.enable.types` feature flag, in order to distinguish between typed and legacy processes in the language. When a script enables this feature flag, its processes are treated as typed processes; otherwise, its processes are treated as legacy processes. This way, typed and legacy processes cannot be mixed in the same script, but they can be used together as long as they are declared in different scripts. diff --git a/adr/20260306-record-types.md b/adr/20260306-record-types.md index 070ea05da3..106e085c9f 100644 --- a/adr/20260306-record-types.md +++ b/adr/20260306-record-types.md @@ -341,7 +341,7 @@ process FASTQC { This approach is syntactically more concise, and it re-uses the typed output syntax that was introduced in Nextflow 25.10. -However, with this approach, the same syntax can have different meanings depending on the surrounding context (e.g. presence/absence of the `nextflow.preview.types` feature flag), which can be confusing for both users and agents. +However, with this approach, the same syntax can have different meanings depending on the surrounding context (e.g. presence/absence of the `nextflow.enable.types` feature flag), which can be confusing for both users and agents. The `record()` approach works "out of the box", and it isn't much more verbose, so we decided that it is sufficient for now. diff --git a/adr/20260310-typed-workflows.md b/adr/20260310-typed-workflows.md index ed6724cb7a..0b202ba421 100644 --- a/adr/20260310-typed-workflows.md +++ b/adr/20260310-typed-workflows.md @@ -85,11 +85,11 @@ Even the pipe (`|`), which is loved by many users, can rarely be used in its ide Introduce **typed workflows**, which provide a streamlined syntax for workflows that supports static typing. -Typed workflows can be used with the `nextflow.preview.types` feature flag: +Typed workflows can be used with the `nextflow.enable.types` feature flag: ```groovy // typed workflow -nextflow.preview.types = true +nextflow.enable.types = true workflow HELLO { take: @@ -131,7 +131,7 @@ The operator library is extended to support static typing and records: All operators can be used with or without static typing, with some caveats: -- Some operators have stricter semantics when static typing is enabled via `nextflow.preview.types`. These changes are necessary in order to support static typing effectively. They should not affect the majority of existing code. +- Some operators have stricter semantics when static typing is enabled via `nextflow.enable.types`. These changes are necessary in order to support static typing effectively. They should not affect the majority of existing code. - Some operators are discouraged from use with static typing. While they can still be used, the type checker will not be able to validate them. Users should be encouraged to migrate away from them in favor of the *core operators* that are statically typed. @@ -219,7 +219,7 @@ This incremental approach was done in contrast to DSL2, which was a monolithic c Most of the features for static typing are new concepts that can be used alongside existing code. However, typed processes and typed workflows modify existing concepts (`process` and `workflow` definitions), so they require a feature flag. -The `nextflow.enable.types` feature flag (currently in preview as `nextflow.preview.types`) will be used to distinguish between typed and legacy code, indefinitely. It would only be removed if the support for legacy syntax was removed, which is unlikely since DSL2 has been the standard Nextflow syntax for many years. +The `nextflow.enable.types` feature flag will be used to distinguish between typed and legacy code, indefinitely. It would only be removed if the support for legacy syntax was removed, which is unlikely since DSL2 has been the standard Nextflow syntax for many years. To help distinguish between typed and legacy workflows, the use of type annotations should be allowed only for typed workflows: @@ -239,7 +239,7 @@ workflow greet { ```groovy // typed workflow -nextflow.preview.types = true +nextflow.enable.types = true workflow greet { take: @@ -261,7 +261,7 @@ Typed and legacy workflows use different underlying dataflow types: - **Typed workflows (v2)** use wrapper types: `ChannelImpl` (wraps a `DataflowBroadcast`) and `ValueImpl` (wraps a `DataflowVariable`). These wrappers implement the new operators and integrate with the type system. -While a given script must be entirely typed or entirely legacy (controlled by the `nextflow.preview.types` flag), **typed and legacy workflows can call each other across different scripts**. This interoperability enables incremental migration -- individual scripts can be migrated to static typing without having to update the entire pipeline at once. +While a given script must be entirely typed or entirely legacy (controlled by the `nextflow.enable.types` flag), **typed and legacy workflows can call each other across different scripts**. This interoperability enables incremental migration -- individual scripts can be migrated to static typing without having to update the entire pipeline at once. ### Normalization at call sites @@ -293,7 +293,7 @@ workflow LEGACY_ALIGN { **`typed.nf`** ```groovy -nextflow.preview.types = true +nextflow.enable.types = true include { LEGACY_ALIGN } from './legacy' @@ -312,7 +312,7 @@ workflow { **`typed.nf`** ```groovy -nextflow.preview.types = true +nextflow.enable.types = true workflow TYPED_TRIM { take: @@ -371,7 +371,7 @@ workflow LEGACY_QC { **`typed.nf`** ```groovy -nextflow.preview.types = true +nextflow.enable.types = true include { LEGACY_QC } from './legacy' diff --git a/docs/migrations/26-04.md b/docs/migrations/26-04.md index 42afdddb28..0d83048696 100644 --- a/docs/migrations/26-04.md +++ b/docs/migrations/26-04.md @@ -97,7 +97,7 @@ See {ref}`script-records` for details. See {ref}`migrating-static-types` for mor

Static typing (preview)

:::{note} -Typed processes and typed workflows require the `nextflow.preview.types` feature flag to be enabled in every script that uses them. +Typed processes and typed workflows require the `nextflow.enable.types` feature flag to be enabled in every script that uses them. ::: Nextflow 26.04 brings full support for static typing with {ref}`typed processes ` and {ref}`typed workflows `. @@ -105,7 +105,7 @@ Nextflow 26.04 brings full support for static typing with {ref}`typed processes Typed processes can now declare record inputs and outputs: ```nextflow -nextflow.preview.types = true +nextflow.enable.types = true process FASTQC { input: @@ -129,7 +129,7 @@ process FASTQC { Typed workflows can declare typed inputs and outputs, and provide first-class support for static typing in dataflow logic: ```nextflow -nextflow.preview.types = true +nextflow.enable.types = true workflow RNASEQ { take: @@ -158,6 +158,10 @@ Several operators have been extended to support static typing and records: Breaking changes from the {ref}`first preview `: +- The `nextflow.preview.types` feature flag has been replaced with `nextflow.enable.types`. + +- The `nextflow.enable.types` feature flag must be enabled in order to use type annotations in workflow takes/emits. + - The syntax for process tuple inputs has been updated: ```nextflow @@ -172,8 +176,6 @@ Breaking changes from the {ref}`first preview `: - The method signature for the `stageAs` directive was changed from `(filePattern, value)` to `(value, filePattern)`. -- The `nextflow.preview.types` feature flag must be enabled in order to use type annotations in workflow takes/emits. - See {ref}`migrating-static-types` for more information about migrating to static typing. See {ref}`migrating-static-types-operators` for best practices on using operators with static typing. ## Enhancements diff --git a/docs/process-typed.md b/docs/process-typed.md index 32cb141c45..b8eacac6c7 100644 --- a/docs/process-typed.md +++ b/docs/process-typed.md @@ -12,7 +12,7 @@ Typed processes are a preview feature. The syntax and behavior may change in fut Typed processes use a new syntax for inputs and outputs that supports static typing. ```nextflow -nextflow.preview.types = true +nextflow.enable.types = true process hello { input: @@ -36,7 +36,7 @@ To use this feature: export NXF_SYNTAX_PARSER=v2 ``` -2. Set `nextflow.preview.types = true` in every script that uses typed processes. +2. Set `nextflow.enable.types = true` in every script that uses typed processes. See {ref}`syntax-process-typed` for the complete syntax reference and {ref}`migrating-static-types` to migrate existing code to static typing. diff --git a/docs/reference/channel.md b/docs/reference/channel.md index 69382080f0..736487be5e 100644 --- a/docs/reference/channel.md +++ b/docs/reference/channel.md @@ -354,7 +354,7 @@ A *topic channel* is a channel that can receive values from many sources *implic A typed process can emit values to a topic using the `topic:` section: ```nextflow -nextflow.preview.types = true +nextflow.enable.types = true process hello { topic: diff --git a/docs/reference/feature-flags.md b/docs/reference/feature-flags.md index 2eea415904..c505f367ab 100644 --- a/docs/reference/feature-flags.md +++ b/docs/reference/feature-flags.md @@ -2,10 +2,10 @@ # Feature flags -Feature flags enable experimental or other opt-in features. They must be specified in the pipeline script. +Feature flags enable opt-in features. They must be specified in the pipeline script. :::{warning} -Feature flags with the `nextflow.preview` prefix can cause pipelines run with newer versions of Nextflow to fail due to breaking changes. Always consult the {ref}`migration notes ` before updating to a new Nextflow version. +Feature flags marked as *preview* can cause pipelines run with newer versions of Nextflow to fail due to breaking changes. Always consult the {ref}`migration notes ` before updating to a new Nextflow version. ::: `nextflow.enable.configProcessNamesValidation` @@ -49,28 +49,8 @@ Feature flags with the `nextflow.preview` prefix can cause pipelines run with ne - Nextflow will fail if multiple functions and/or processes with the same name are defined in a module script -`nextflow.preview.output` -: :::{versionadded} 24.04.0 - ::: -: :::{deprecated} 25.10.0 - This feature flag is no longer supported. Workflow outputs are out of preview. - ::: -: When `true`, enables the use of {ref}`workflow outputs `. - -`nextflow.preview.recursion` -: *Preview feature: the syntax and behavior may change in future releases.* -: When `true`, enables {ref}`process and workflow recursion `. - -`nextflow.preview.topic` -: :::{versionadded} 24.04.0 - ::: -: :::{deprecated} 25.04.0 - This feature flag is no longer supported. Topic channels are out of preview. - ::: -: When `true`, enables the use of {ref}`topic channels `. - -`nextflow.preview.types` -: :::{versionadded} 25.10.0 +`nextflow.enable.types` +: :::{versionadded} 26.04.0 ::: : *Preview feature: the syntax and behavior may change in future releases.* : When `true`, enables the use of {ref}`typed processes ` and {ref}`typed workflows `. Must be enabled in every script that uses typed processes/workflows. Legacy processes/workflows cannot be defined in scripts with this flag enabled. diff --git a/docs/reference/operator.md b/docs/reference/operator.md index e0942fffe0..078acce2d1 100644 --- a/docs/reference/operator.md +++ b/docs/reference/operator.md @@ -208,7 +208,7 @@ The `collect` operator behaves differently from `toList` in the following ways: - `collect` flattens collected values whereas `toList` does not. :::{note} -When static typing is enabled via `nextflow.preview.types`, `collect` behaves the same way as `toList`. +When static typing is enabled via `nextflow.enable.types`, `collect` behaves the same way as `toList`. ::: ## collectFile @@ -527,7 +527,7 @@ When the mapping function returns a map, each key-value pair in the map is emitt ``` :::{note} -When static typing is enabled via `nextflow.preview.types`, `flatMap` does not flatten maps or tuples. +When static typing is enabled via `nextflow.enable.types`, `flatMap` does not flatten maps or tuples. ::: (operator-flatten)= @@ -728,7 +728,7 @@ The `map` operator applies a *mapping function* to each item from a source chann ``` :::{note} -By default, null values are not emitted by `map`. When static typing is enabled via `nextflow.preview.types`, null values are emitted. +By default, null values are not emitted by `map`. When static typing is enabled via `nextflow.enable.types`, null values are emitted. ::: (operator-max)= diff --git a/docs/reference/process.md b/docs/reference/process.md index 4032aa1e0d..3b1bde04a9 100644 --- a/docs/reference/process.md +++ b/docs/reference/process.md @@ -63,7 +63,7 @@ The following task properties are defined in the process body: ::: :::{note} -Typed processes require the `nextflow.preview.types` feature flag to be enabled in every script that uses them. The syntax and behavior may change in future releases. +Typed processes require the `nextflow.enable.types` feature flag to be enabled in every script that uses them. ::: ### Stage directives diff --git a/docs/reference/syntax.md b/docs/reference/syntax.md index 99682ac7df..a92c300a74 100644 --- a/docs/reference/syntax.md +++ b/docs/reference/syntax.md @@ -205,7 +205,7 @@ Entry workflow definitions are ignored when a script is included as a module. Th A typed workflow is a workflow that uses static typing for inputs and outputs: ```nextflow -nextflow.preview.types = true +nextflow.enable.types = true workflow greet { take: @@ -303,7 +303,7 @@ See {ref}`process-page` for more information on the semantics of each process se A typed process is a process that uses static typing for inputs and outputs: ```nextflow -nextflow.preview.types = true +nextflow.enable.types = true process greet { input: diff --git a/docs/tutorials/static-types-operators.md b/docs/tutorials/static-types-operators.md index 88c23eb513..ed4519711e 100644 --- a/docs/tutorials/static-types-operators.md +++ b/docs/tutorials/static-types-operators.md @@ -12,7 +12,7 @@ All operators can be used with or without static typing (i.e. {ref}`typed workfl ## Core operators -The {ref}`core operators ` are recommended for use with static typing. When static typing is enabled (via `nextflow.preview.types`), some of these operators have stricter semantics which may require minor changes to pipeline code. These cases are described below. +The {ref}`core operators ` are recommended for use with static typing. When static typing is enabled (via `nextflow.enable.types`), some of these operators have stricter semantics which may require minor changes to pipeline code. These cases are described below. ### collect @@ -264,7 +264,7 @@ You can compose these functions and operators as needed to achieve the desired f For example: ```nextflow -nextflow.preview.types = true +nextflow.enable.types = true process COLLECT_FILE { input: diff --git a/docs/tutorials/static-types.md b/docs/tutorials/static-types.md index 3f6b42d322..7c524a069b 100644 --- a/docs/tutorials/static-types.md +++ b/docs/tutorials/static-types.md @@ -30,7 +30,7 @@ See {ref}`devenv-page` for instructions on how to setup VS Code and the Nextflow When using static typing, the language server can check your code for type-related errors. For example, it can validate that a channel of records has all the required fields when it is passed as input to a process. -The language server performs type checking on every script that enables the `nextflow.preview.types` feature flag. +The language server performs type checking on every script that enables the `nextflow.enable.types` feature flag. ### Automatic migration @@ -212,7 +212,7 @@ Collection-type params can also be loaded from JSON and YAML samplesheets. See { See {ref}`process-typed-page` for an overview of typed processes. :::{note} -You must enable the `nextflow.preview.types` feature flag in each script that uses typed processes. +You must enable the `nextflow.enable.types` feature flag in each script that uses typed processes. :::

FASTQC

@@ -240,7 +240,7 @@ process FASTQC { To migrate the `FASTQC` process, rewrite the inputs and outputs as follows: ```nextflow -nextflow.preview.types = true +nextflow.enable.types = true process FASTQC { tag id @@ -304,7 +304,7 @@ process QUANT { To migrate the `QUANT` process, rewrite the inputs and outputs as follows: ```nextflow -nextflow.preview.types = true +nextflow.enable.types = true process QUANT { tag id @@ -364,7 +364,7 @@ process MULTIQC { To migrate this process, rewrite the inputs and outputs as follows: ```nextflow -nextflow.preview.types = true +nextflow.enable.types = true process MULTIQC { // ... @@ -406,7 +406,7 @@ Once you migrate every process called by a workflow to static typing, you can mi See {ref}`workflow-typed-page` for an overview of typed workflows. :::{note} -You must enable the `nextflow.preview.types` feature flag in each script that uses typed workflows. +You must enable the `nextflow.enable.types` feature flag in each script that uses typed workflows. :::

RNASEQ

@@ -451,7 +451,7 @@ You can determine the type of each input as follows: Specify the workflow input types as follows: ```nextflow -nextflow.preview.types = true +nextflow.enable.types = true workflow RNASEQ { take: @@ -491,7 +491,7 @@ These channels are emitted as the outputs of `RNASEQ`. However, with records it Use the `join` operator to join `fastqc_ch` and `quant_ch` by sample ID: ```nextflow -nextflow.preview.types = true +nextflow.enable.types = true workflow RNASEQ { take: @@ -525,7 +525,7 @@ record AlignedSample { Update the workflow to emit `samples_ch` with the new record type: ```nextflow -nextflow.preview.types = true +nextflow.enable.types = true workflow RNASEQ { take: @@ -562,7 +562,7 @@ workflow { Rewrite this workflow based on the updated params, processes, and subworkflows: ```nextflow -nextflow.preview.types = true +nextflow.enable.types = true workflow { read_pairs_ch = channel.fromList(params.reads) diff --git a/docs/workflow-typed.md b/docs/workflow-typed.md index ce590548d5..b384a90407 100644 --- a/docs/workflow-typed.md +++ b/docs/workflow-typed.md @@ -12,7 +12,7 @@ To use this feature: export NXF_SYNTAX_PARSER=v2 ``` -2. Set `nextflow.preview.types = true` in every script that uses typed workflows. The `params` block and `output` block can be used without this feature flag. +2. Set `nextflow.enable.types = true` in every script that uses typed workflows. The `params` block and `output` block can be used without this feature flag. See {ref}`syntax-workflow-typed` for the complete syntax reference and {ref}`migrating-static-types` to migrate existing code to static typing. @@ -66,7 +66,7 @@ When supplying a CSV file to a collection parameter, the CSV file must contain a Workflow outputs can use type annotations: ```nextflow -nextflow.preview.types = true +nextflow.enable.types = true params { input: String @@ -135,7 +135,7 @@ Typed workflows are a preview feature. The syntax and behavior may change in fut Typed workflows can use type annotations in the `take:` and `emit:` sections: ```nextflow -nextflow.preview.types = true +nextflow.enable.types = true workflow hello_bye { take: diff --git a/modules/nextflow/src/main/groovy/nextflow/script/DataflowTypeHelper.groovy b/modules/nextflow/src/main/groovy/nextflow/script/DataflowTypeHelper.groovy index 93efa1ab15..f4b669cb20 100644 --- a/modules/nextflow/src/main/groovy/nextflow/script/DataflowTypeHelper.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/script/DataflowTypeHelper.groovy @@ -27,7 +27,7 @@ import org.codehaus.groovy.runtime.InvokerHelper /** * Utility functions for converting between v1 and v2 dataflow types. * - * When a script enables the `nextflow.preview.types` flag, its workflows + * When a script enables the `nextflow.enable.types` flag, its workflows * are "typed workflows", otherwise they are "legacy workflows": * * - Typed workflows use v2 dataflow types: ChannelImpl, ValueImpl diff --git a/modules/nextflow/src/test/groovy/nextflow/dataflow/ChannelImplTest.groovy b/modules/nextflow/src/test/groovy/nextflow/dataflow/ChannelImplTest.groovy index 8d7201db6f..beeff1a404 100644 --- a/modules/nextflow/src/test/groovy/nextflow/dataflow/ChannelImplTest.groovy +++ b/modules/nextflow/src/test/groovy/nextflow/dataflow/ChannelImplTest.groovy @@ -205,7 +205,7 @@ class ChannelImplTest extends Specification { when: runScript( '''\ - nextflow.preview.types = true + nextflow.enable.types = true workflow { channel.of(tuple(1,2)).flatMap() @@ -260,7 +260,7 @@ class ChannelImplTest extends Specification { when: runScript( '''\ - nextflow.preview.types = true + nextflow.enable.types = true workflow { channel.of(1, 2, 3).groupBy() @@ -275,7 +275,7 @@ class ChannelImplTest extends Specification { when: runScript( '''\ - nextflow.preview.types = true + nextflow.enable.types = true workflow { channel.of([1, 1, 'a'], [1, 1, 'b']).groupBy() @@ -290,7 +290,7 @@ class ChannelImplTest extends Specification { when: runScript( '''\ - nextflow.preview.types = true + nextflow.enable.types = true workflow { channel.of([1, 2, 'a'], [1, 3, 'b']).groupBy() @@ -305,7 +305,7 @@ class ChannelImplTest extends Specification { when: runScript( '''\ - nextflow.preview.types = true + nextflow.enable.types = true workflow { channel.of([1, 3, 'a'], [1, 3, 'b']).groupBy() @@ -392,7 +392,7 @@ class ChannelImplTest extends Specification { when: runScript( '''\ - nextflow.preview.types = true + nextflow.enable.types = true workflow { left = channel.of(1, 2, 3) @@ -490,7 +490,7 @@ class ChannelImplTest extends Specification { when: runScript( '''\ - nextflow.preview.types = true + nextflow.enable.types = true workflow { channel.empty().reduce { acc, v -> acc + v } @@ -659,7 +659,7 @@ class ChannelImplTest extends Specification { when: runScript( '''\ - nextflow.preview.types = true + nextflow.enable.types = true workflow { channel.of(1, 2, 3).subscribe { v -> @@ -678,7 +678,7 @@ class ChannelImplTest extends Specification { when: def result = runScript( '''\ - nextflow.preview.types = true + nextflow.enable.types = true workflow { channel.of(1, [2, 3], 4).flatten() diff --git a/modules/nextflow/src/test/groovy/nextflow/dataflow/ValueImplTest.groovy b/modules/nextflow/src/test/groovy/nextflow/dataflow/ValueImplTest.groovy index f1b784a7e5..6c2b840f0a 100644 --- a/modules/nextflow/src/test/groovy/nextflow/dataflow/ValueImplTest.groovy +++ b/modules/nextflow/src/test/groovy/nextflow/dataflow/ValueImplTest.groovy @@ -157,7 +157,7 @@ class ValueImplTest extends Specification { when: def result = runScript( '''\ - nextflow.preview.types = true + nextflow.enable.types = true workflow { channel.value([1, 'alpha']).cross( channel.value([1, 'x']) ) diff --git a/modules/nextflow/src/test/groovy/nextflow/module/ModuleSpecFactoryTest.groovy b/modules/nextflow/src/test/groovy/nextflow/module/ModuleSpecFactoryTest.groovy index 6e5044742a..c538586706 100644 --- a/modules/nextflow/src/test/groovy/nextflow/module/ModuleSpecFactoryTest.groovy +++ b/modules/nextflow/src/test/groovy/nextflow/module/ModuleSpecFactoryTest.groovy @@ -431,7 +431,7 @@ class ModuleSpecFactoryTest extends Specification { given: def mainNf = tempDir.resolve('main.nf') mainNf.text = '''\ - nextflow.preview.types = true + nextflow.enable.types = true process ALIGN { input: @@ -472,7 +472,7 @@ class ModuleSpecFactoryTest extends Specification { given: def mainNf = tempDir.resolve('main.nf') mainNf.text = '''\ - nextflow.preview.types = true + nextflow.enable.types = true process ALIGN { input: @@ -526,7 +526,7 @@ class ModuleSpecFactoryTest extends Specification { given: def mainNf = tempDir.resolve('main.nf') mainNf.text = '''\ - nextflow.preview.types = true + nextflow.enable.types = true process ALIGN { input: diff --git a/modules/nextflow/src/test/groovy/nextflow/script/DataflowTypesTest.groovy b/modules/nextflow/src/test/groovy/nextflow/script/DataflowTypesTest.groovy index 1c620983db..0021e771a2 100644 --- a/modules/nextflow/src/test/groovy/nextflow/script/DataflowTypesTest.groovy +++ b/modules/nextflow/src/test/groovy/nextflow/script/DataflowTypesTest.groovy @@ -85,7 +85,7 @@ class DataflowTypesTest extends Dsl2Spec { ''' folder.resolve('module.nf').text = ''' - nextflow.preview.types = true + nextflow.enable.types = true process foo { input: @@ -121,7 +121,7 @@ class DataflowTypesTest extends Dsl2Spec { def folder = Files.createTempDirectory('test') folder.resolve('main.nf').text = ''' - nextflow.preview.types = true + nextflow.enable.types = true include { foo ; bar } from './module.nf' @@ -166,7 +166,7 @@ class DataflowTypesTest extends Dsl2Spec { def folder = Files.createTempDirectory('test') folder.resolve('main.nf').text = ''' - nextflow.preview.types = true + nextflow.enable.types = true include { foo ; bar } from './module.nf' @@ -177,7 +177,7 @@ class DataflowTypesTest extends Dsl2Spec { ''' folder.resolve('module.nf').text = ''' - nextflow.preview.types = true + nextflow.enable.types = true process foo { input: diff --git a/modules/nextflow/src/test/groovy/nextflow/script/parser/v2/ScriptLoaderV2Test.groovy b/modules/nextflow/src/test/groovy/nextflow/script/parser/v2/ScriptLoaderV2Test.groovy index c87b7b50c9..001938d3ba 100644 --- a/modules/nextflow/src/test/groovy/nextflow/script/parser/v2/ScriptLoaderV2Test.groovy +++ b/modules/nextflow/src/test/groovy/nextflow/script/parser/v2/ScriptLoaderV2Test.groovy @@ -310,7 +310,7 @@ class ScriptLoaderV2Test extends Dsl2Spec { def TEXT = ''' - nextflow.preview.types = true + nextflow.enable.types = true process hello { diff --git a/modules/nf-lang/src/main/java/nextflow/script/ast/ScriptNode.java b/modules/nf-lang/src/main/java/nextflow/script/ast/ScriptNode.java index 4f02dcdc37..ccb43f3d2a 100644 --- a/modules/nf-lang/src/main/java/nextflow/script/ast/ScriptNode.java +++ b/modules/nf-lang/src/main/java/nextflow/script/ast/ScriptNode.java @@ -157,7 +157,7 @@ public void addFunction(FunctionNode functionNode) { public boolean isTypingEnabled() { return featureFlags.stream().anyMatch(ffn -> ( - "nextflow.preview.types".equals(ffn.name) + "nextflow.enable.types".equals(ffn.name) && ffn.value instanceof ConstantExpression ce && Boolean.TRUE.equals(ce.getValue()) )); diff --git a/modules/nf-lang/src/main/java/nextflow/script/control/ScriptToGroovyVisitor.java b/modules/nf-lang/src/main/java/nextflow/script/control/ScriptToGroovyVisitor.java index 6e943a2be6..cc0a50f089 100644 --- a/modules/nf-lang/src/main/java/nextflow/script/control/ScriptToGroovyVisitor.java +++ b/modules/nf-lang/src/main/java/nextflow/script/control/ScriptToGroovyVisitor.java @@ -129,7 +129,7 @@ else if( decl instanceof WorkflowNode wn ) @Override public void visitFeatureFlag(FeatureFlagNode node) { // static typing is enabled per-script rather than globally - if( "nextflow.preview.types".equals(node.name) ) + if( "nextflow.enable.types".equals(node.name) ) return; var names = node.name.split("\\."); diff --git a/modules/nf-lang/src/main/java/nextflow/script/dsl/FeatureFlagDsl.java b/modules/nf-lang/src/main/java/nextflow/script/dsl/FeatureFlagDsl.java index 1e9ee17738..6ce8926a4a 100644 --- a/modules/nf-lang/src/main/java/nextflow/script/dsl/FeatureFlagDsl.java +++ b/modules/nf-lang/src/main/java/nextflow/script/dsl/FeatureFlagDsl.java @@ -44,18 +44,18 @@ Defines the DSL version (`1` or `2`). """) public boolean strict; - @FeatureFlag("nextflow.preview.recursion") - @Description(""" - When `true`, enables the use of [process and workflow recursion](https://nextflow.io/docs/latest/workflow.html#process-and-workflow-recursion). - """) - public boolean previewRecursion; - - @FeatureFlag("nextflow.preview.types") + @FeatureFlag("nextflow.enable.types") @Description(""" When `true`, enables the use of [typed processes](https://nextflow.io/docs/latest/process-typed.html) and [typed workflows](https://nextflow.io/docs/latest/workflow-typed.html). This feature flag must be enabled in every script that uses typed processes/workflows. Legacy processes/workflows can not be defined in scripts that enable this feature flag. """) - public boolean previewTypes; + public boolean types; + + @FeatureFlag("nextflow.preview.recursion") + @Description(""" + When `true`, enables the use of [process and workflow recursion](https://nextflow.io/docs/latest/workflow.html#process-and-workflow-recursion). + """) + public boolean previewRecursion; } diff --git a/modules/nf-lang/src/main/java/nextflow/script/parser/ScriptAstBuilder.java b/modules/nf-lang/src/main/java/nextflow/script/parser/ScriptAstBuilder.java index 6987d91f26..fda81b988a 100644 --- a/modules/nf-lang/src/main/java/nextflow/script/parser/ScriptAstBuilder.java +++ b/modules/nf-lang/src/main/java/nextflow/script/parser/ScriptAstBuilder.java @@ -390,7 +390,7 @@ private Parameter paramDeclaration(ParamDeclarationContext ctx) { private ParamNodeV1 paramDeclarationV1(ParamDeclarationV1Context ctx) { if( typingEnabled ) { - collectSyntaxError(new SyntaxException("Legacy parameter is not allowed with `nextflow.preview.types = true` -- use the `params` block instead", ast(new EmptyStatement(), ctx))); + collectSyntaxError(new SyntaxException("Legacy parameter is not allowed with `nextflow.enable.types = true` -- use the `params` block instead", ast(new EmptyStatement(), ctx))); return null; } Expression target = ast( varX("params"), ctx.PARAMS() ); @@ -609,7 +609,7 @@ else if( ctx.identifier() != null && ctx.type() == null ) { result = ast( stmt(variableName(ctx.identifier())), ctx ); } else { - collectSyntaxError(new SyntaxException("Typed input declaration is not allowed in legacy process -- set `nextflow.preview.types = true` to use typed processes in this script", ast(new EmptyStatement(), ctx))); + collectSyntaxError(new SyntaxException("Typed input declaration is not allowed in legacy process -- set `nextflow.enable.types = true` to use typed processes in this script", ast(new EmptyStatement(), ctx))); return null; } return checkDirective(result, "Invalid process input"); @@ -687,7 +687,7 @@ else if( ctx.nameTypePair().identifier() != null && ctx.nameTypePair().type() == result = ast( stmt(variableName(ctx.nameTypePair().identifier())), ctx ); } else { - collectSyntaxError(new SyntaxException("Typed output declaration is not allowed in legacy process -- set `nextflow.preview.types = true` to use typed processes in this script", ast(new EmptyStatement(), ctx))); + collectSyntaxError(new SyntaxException("Typed output declaration is not allowed in legacy process -- set `nextflow.enable.types = true` to use typed processes in this script", ast(new EmptyStatement(), ctx))); return null; } return checkDirective(result, "Invalid process output"); @@ -849,7 +849,7 @@ private Parameter workflowTake(WorkflowTakeContext ctx) { return null; } if( !typingEnabled && ctx.type() != null ) { - collectSyntaxError(new SyntaxException("Typed input is not allowed in legacy workflow -- set `nextflow.preview.types = true` to use typed workflows in this script", ast(new EmptyStatement(), ctx))); + collectSyntaxError(new SyntaxException("Typed input is not allowed in legacy workflow -- set `nextflow.enable.types = true` to use typed workflows in this script", ast(new EmptyStatement(), ctx))); return null; } var type = type(ctx.type()); @@ -902,7 +902,7 @@ else if( ctx.expression() != null ) { result = stmt(target); } if( !typingEnabled && ctx.nameTypePair() != null && ctx.nameTypePair().type() != null ) { - collectSyntaxError(new SyntaxException("Typed output is not allowed in legacy workflow -- set `nextflow.preview.types = true` to use typed workflows in this script", result)); + collectSyntaxError(new SyntaxException("Typed output is not allowed in legacy workflow -- set `nextflow.enable.types = true` to use typed workflows in this script", result)); return null; } saveTrailingComment(result, ctx); diff --git a/modules/nf-lang/src/test/groovy/nextflow/script/formatter/ScriptFormatterTest.groovy b/modules/nf-lang/src/test/groovy/nextflow/script/formatter/ScriptFormatterTest.groovy index ec4d8a74dc..9d0f532dc0 100644 --- a/modules/nf-lang/src/test/groovy/nextflow/script/formatter/ScriptFormatterTest.groovy +++ b/modules/nf-lang/src/test/groovy/nextflow/script/formatter/ScriptFormatterTest.groovy @@ -157,14 +157,14 @@ class ScriptFormatterTest extends Specification { expect: checkFormat( '''\ - nextflow.preview.types = true + nextflow.enable.types = true workflow hello{ take: x:Integer ; y:Integer ; main: xy=x*y ; emit: result:Integer = xy } ''', '''\ - nextflow.preview.types = true + nextflow.enable.types = true workflow hello { take: @@ -211,14 +211,14 @@ class ScriptFormatterTest extends Specification { expect: checkFormat( '''\ - nextflow.preview.types=true + nextflow.enable.types=true process hello{ debug(true) ; input: tuple(id:String,infile:Path) ; index:Path ; stage: stageAs(infile,'input.txt') ; output: result=tuple(id,file('output.txt')) ; script: 'cat input.txt > output.txt' } ''', '''\ - nextflow.preview.types = true + nextflow.enable.types = true process hello { debug true @@ -241,14 +241,14 @@ class ScriptFormatterTest extends Specification { checkFormat( '''\ - nextflow.preview.types=true + nextflow.enable.types=true process hello{ input: record(id:String,infile:Path) ; script: 'cat input.txt > output.txt' } ''', '''\ - nextflow.preview.types = true + nextflow.enable.types = true process hello { input: diff --git a/modules/nf-lang/src/test/groovy/nextflow/script/parser/ScriptAstBuilderTest.groovy b/modules/nf-lang/src/test/groovy/nextflow/script/parser/ScriptAstBuilderTest.groovy index a31918c9bf..d0f4e19692 100644 --- a/modules/nf-lang/src/test/groovy/nextflow/script/parser/ScriptAstBuilderTest.groovy +++ b/modules/nf-lang/src/test/groovy/nextflow/script/parser/ScriptAstBuilderTest.groovy @@ -268,15 +268,15 @@ class ScriptAstBuilderTest extends Specification { errors.size() >= 2 errors[0].getStartLine() == 3 errors[0].getStartColumn() == 5 - errors[0].getOriginalMessage() == "Typed input declaration is not allowed in legacy process -- set `nextflow.preview.types = true` to use typed processes in this script" + errors[0].getOriginalMessage() == "Typed input declaration is not allowed in legacy process -- set `nextflow.enable.types = true` to use typed processes in this script" errors[1].getStartLine() == 6 errors[1].getStartColumn() == 5 - errors[1].getOriginalMessage() == "Typed output declaration is not allowed in legacy process -- set `nextflow.preview.types = true` to use typed processes in this script" + errors[1].getOriginalMessage() == "Typed output declaration is not allowed in legacy process -- set `nextflow.enable.types = true` to use typed processes in this script" when: errors = check( '''\ - nextflow.preview.types = true + nextflow.enable.types = true process hello { input: @@ -298,7 +298,7 @@ class ScriptAstBuilderTest extends Specification { when: def errors = check( '''\ - nextflow.preview.types = true + nextflow.enable.types = true process hello { input: @@ -341,7 +341,7 @@ class ScriptAstBuilderTest extends Specification { when: def errors = check( '''\ - nextflow.preview.types = true + nextflow.enable.types = true process hello { input: @@ -361,7 +361,7 @@ class ScriptAstBuilderTest extends Specification { when: errors = check( '''\ - nextflow.preview.types = true + nextflow.enable.types = true process hello { input: @@ -380,7 +380,7 @@ class ScriptAstBuilderTest extends Specification { when: def errors = check( '''\ - nextflow.preview.types = true + nextflow.enable.types = true process hello { input: @@ -402,7 +402,7 @@ class ScriptAstBuilderTest extends Specification { when: def errors = check( '''\ - nextflow.preview.types = true + nextflow.enable.types = true process hello { topic: @@ -422,7 +422,7 @@ class ScriptAstBuilderTest extends Specification { when: errors = check( '''\ - nextflow.preview.types = true + nextflow.enable.types = true process hello { topic: diff --git a/tests/collect-record.nf b/tests/collect-record.nf index 127a7320a1..f6cc5ffc2f 100644 --- a/tests/collect-record.nf +++ b/tests/collect-record.nf @@ -1,6 +1,6 @@ #!/usr/bin/env nextflow -nextflow.preview.types = true +nextflow.enable.types = true /* * fake alignment step producing a BAM and BAI files diff --git a/tests/dynamic-filename-typed.nf b/tests/dynamic-filename-typed.nf index b7d4cbca48..3517168a6d 100644 --- a/tests/dynamic-filename-typed.nf +++ b/tests/dynamic-filename-typed.nf @@ -15,7 +15,7 @@ * limitations under the License. */ -nextflow.preview.types = true +nextflow.enable.types = true params { input: Path diff --git a/tests/env-typed.nf b/tests/env-typed.nf index cd4f971bde..78444d3ad9 100644 --- a/tests/env-typed.nf +++ b/tests/env-typed.nf @@ -15,7 +15,7 @@ * limitations under the License. */ -nextflow.preview.types = true +nextflow.enable.types = true process foo { output: diff --git a/tests/eval-out-typed.nf b/tests/eval-out-typed.nf index 650ed738ed..95962a8c57 100644 --- a/tests/eval-out-typed.nf +++ b/tests/eval-out-typed.nf @@ -15,7 +15,7 @@ * limitations under the License. */ -nextflow.preview.types = true +nextflow.enable.types = true process foo { input: diff --git a/tests/nullable-path.nf b/tests/nullable-path.nf index 8242211f3c..d1869cfaff 100644 --- a/tests/nullable-path.nf +++ b/tests/nullable-path.nf @@ -1,6 +1,6 @@ #!/usr/bin/env nextflow -nextflow.preview.types = true +nextflow.enable.types = true process foo { input: diff --git a/tests/output-dsl.nf b/tests/output-dsl.nf index 3f790a65a3..2ca0f6592e 100644 --- a/tests/output-dsl.nf +++ b/tests/output-dsl.nf @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -nextflow.preview.types = true +nextflow.enable.types = true params { n_samples: Integer = 3 diff --git a/tests/record-types.nf b/tests/record-types.nf index d543288bf1..0094a57b5b 100644 --- a/tests/record-types.nf +++ b/tests/record-types.nf @@ -1,6 +1,6 @@ #!/usr/bin/env nextflow -nextflow.preview.types = true +nextflow.enable.types = true process TOUCH { input: diff --git a/tests/records.nf b/tests/records.nf index 5d2c7dbe57..626d11b0ea 100644 --- a/tests/records.nf +++ b/tests/records.nf @@ -1,6 +1,6 @@ #!/usr/bin/env nextflow -nextflow.preview.types = true +nextflow.enable.types = true process TOUCH { input: diff --git a/tests/topic-channel-typed.nf b/tests/topic-channel-typed.nf index d6450e9f49..1ef746e586 100644 --- a/tests/topic-channel-typed.nf +++ b/tests/topic-channel-typed.nf @@ -1,5 +1,5 @@ -nextflow.preview.types = true +nextflow.enable.types = true process foo { input: diff --git a/tests/type-annotations.nf b/tests/type-annotations.nf index 33fdc1e201..aaa8c0cd6a 100644 --- a/tests/type-annotations.nf +++ b/tests/type-annotations.nf @@ -15,7 +15,7 @@ * limitations under the License. */ -nextflow.preview.types = true +nextflow.enable.types = true workflow { ch_words = channel.of('one', 'two', 'three', 'four')