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

Formatter mess up if-else statements indention #152

Closed
y9c opened this issue Jul 9, 2022 · 5 comments
Closed

Formatter mess up if-else statements indention #152

y9c opened this issue Jul 9, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@y9c
Copy link

y9c commented Jul 9, 2022

Take this input as an example, by running snakefmt, the indent will be wrong.

rule cutadapt:
    input:
        "a.txt"
    output:
        "b.txt"
    run:
        if (  
             "xxxxxxxxxxxxxxxxxxxxxx" not in wildcards.rn                
               and "yyyyyyyyyyyyyyyyyyyyyyyyyy" not in wildcards.rn 
           ):                                                                                                                 
            shell(
            """ 
            cutadapt \
                -m 30 \
                {input} \
                -o {output}
            """
            )
        else:
            shell(
            """
            cutadapt \
                {input} \
                -o {output}
            """
            )
@y9c
Copy link
Author

y9c commented Jul 9, 2022

New space will be added on each run.

@y9c
Copy link
Author

y9c commented Jul 9, 2022

I figure out that the cause is from the if statment, which is too long.

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

This is probably a result of #151 I suspect. I'll try and take a look at it this week sorry.

@mbhall88
Copy link
Member

mbhall88 commented Jul 13, 2022

This is not related to #151 in the end. Its a bit trickier. Leave it with me and I'll try get to the bottom of it soon.

@mbhall88
Copy link
Member

mbhall88 commented Nov 8, 2022

This will be fixed in the next release

@mbhall88 mbhall88 closed this as completed Nov 8, 2022
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