Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closure with ternary in process settings causes syntax highlighting to be lost #5

Open
awgymer opened this issue Feb 18, 2022 · 0 comments

Comments

@awgymer
Copy link

awgymer commented Feb 18, 2022

I originally raised this issue on the nf-core fork of this repo but I am not sure anyone checks those so I am duplicating here. Sorry if that's overkill.

When implementing a conditional errorStrategy as suggested here I have found that having a ternary expression inside a closure for process settings causes the syntax highlighting to be lost. A small example can be seen in this screenshot (text included for ease of reproducing).

image

/* 
 * Enable DSL 2 syntax
 */
nextflow.enable.dsl = 2


process PROC1 {
    cache true
    memory { 2.GB * task.attempt }
    errorStrategy { task.attempt <= 3 ? 'retry':'ignore' }
    maxRetries 3

    input: 
    path fasta
 
    output: 
    path "${fasta}.fai"
  
    script:
    """
    samtools faidx ${fasta}
    """
}


process PROC2 {
    cache true
    memory { 2.GB * task.attempt }
    maxRetries 3

    input: 
    path fasta
 
    output: 
    path "${fasta}.fai"
  
    script:
    """
    samtools faidx ${fasta}
    """
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant