snakemake / snakefmt

The uncompromising Snakemake code formatter
MIT License
153 stars 29 forks source link

`snakefmt.exceptions.InvalidParameterSyntax` raised for `resources` directive #108

Closed kpj closed 3 years ago

kpj commented 3 years ago

I am using snakefmt, version 0.4.1.

Consider the following Snakefile:

rule foo:
    input:
        "foo",
    output:
        "foo",
    resources:
        time_min=lambda wildcards, attempt: (
            60 * 23 if "cv" in wildcards.method else 60 * 10
        ) * attempt,

Executing snakefmt on it results in this error:

snakefmt.exceptions.InvalidParameterSyntax: 8time_min=lambda wildcards, attempt:(
60*23 if"cv" in wildcards. method else60*10
)* attempt

This confuses me as this is a working Snakefile. Do you have any idea what might be going wrong? Maybe the recently introduced time_min parameter from the LSF profile is confusing it?

bricoletc commented 3 years ago

Sorry for the late reply, looking into this, is most likely a parsing error