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

Problem with multi-line script strings #59

Closed
holtgrewe opened this issue Aug 17, 2020 · 6 comments · Fixed by #60
Closed

Problem with multi-line script strings #59

holtgrewe opened this issue Aug 17, 2020 · 6 comments · Fixed by #60
Labels
bug Something isn't working

Comments

@holtgrewe
Copy link

rule top:
    shell:
        r"""
        Multi_line
        """

becomes

rule top:
    shell:
        r"""
                Multi_line
                """

becomes

rule top:
    shell:
        r"""
                        Multi_line
                        """

etc.

@mbhall88
Copy link
Member

Hi @holtgrewe

Can I ask why you are using an r-string? If you remove the r snakefmt produces the desired output.

@holtgrewe
Copy link
Author

@mbhall88 thanks for the info. I'm using the string as I'm regularly using \ in my shell scripts :D

@mbhall88 mbhall88 added the bug Something isn't working label Aug 18, 2020
@mbhall88
Copy link
Member

Ah yes, I figured that might be the case. Ok, we will work on implementing a fix for this and let you know.

@mbhall88
Copy link
Member

@holtgrewe could you try out the tip of dev and make sure it fixes issue for you?

@mbhall88 mbhall88 reopened this Aug 20, 2020
@bricoletc
Copy link
Collaborator

I added an extra fix for when you have several triple quoted strings consecutively like

rule top:
    shell:
        r"""
        Multi_line
        """
        f"""
        Other Multi_line
        """

I discovered we were failing on this, is now covered.

@bricoletc
Copy link
Collaborator

@holtgrewe could you try out the tip of dev and make sure it fixes issue for you?

@mbhall88 I think we can close and let @holtgrewe or anyone else comment here if relevant?

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

Successfully merging a pull request may close this issue.

3 participants