Skip to content

Nextflow lint removes required parens in map assignment #6892

@StephenTannerAtTempus

Description

@StephenTannerAtTempus

Bug report

Expected behavior and actual behavior

I am running nextflow lint -format . to check and pretty-print my nextflow files. My main.nf file includes a map assignment of the form: map_map = [(params.abc): params.defg] Note that the parens around (params.abc) are required. After running nextflow lint -format, the parens are removed, which leads to a parse error like this:

Error nextflow_tutorial/hello_world.nf:49:26: Unexpected input: ':'
│  49 |     map_map = [params.abc: params.defg]

Steps to reproduce the problem

Include this assignment map_map = [(params.abc): params.defg], where params.abc and params.defg are arbitrary strings assigned in nextlfow.config. Run nextflow lint -format

Program output

(Copy and paste the output produced by the failing execution. Please highlight it as a code block. Whenever possible upload the .nextflow.log file.)

Environment

  • Nextflow version: 25.10.4
  • Java version: openjdk version "17.0.10" 2024-01-16
  • Operating system: macOS
  • Bash version: zsh 5.9

Additional context

My overall goal is trying avoid using "magic strings". For maintainability reasons, I want to avoid including the same hard-coded string in several places across several files. In an effort to do that, I defined some strings in params. That's what's driving the use of params values as keys in a map.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions