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

Long parenthesis within rule settings breaks code #240

Open
lczech opened this issue Jul 11, 2024 · 1 comment
Open

Long parenthesis within rule settings breaks code #240

lczech opened this issue Jul 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@lczech
Copy link

lczech commented Jul 11, 2024

This is with snakefmt v0.10.2.

Minimal example:

rule call_variants:
    input:
        some_file
    threads:
        max(
            1,
            int(config["params"]["call_variants"]["threads"]) -
            int(config["params"]["call_variants"]["compress-threads"])
        )

gets reformatted to

rule call_variants:
    input:
        some_file,
    threads: max(
    1,
    int(config["params"]["call_variants"]["threads"])
    - int(config["params"]["call_variants"]["compress-threads"]),
)

This cannot be parsed again, as calling snakefmt again on this yields:

snakefmt.exceptions.InvalidParameterSyntax: 5max(

The issue is only appearing due to the long lines. Removing this, computing the needed value beforehand, and instead just having a shorter statement there, works.

@mbhall88 mbhall88 added the bug Something isn't working label Jul 11, 2024
@mbhall88
Copy link
Member

I think this is the same underlying issue for #208

We'll try and investigate this soon (sorry, writing grants at the moment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants