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

Prevent newline for shell triple-quote #201

Open
alpha-beta-soup opened this issue Sep 17, 2023 · 1 comment
Open

Prevent newline for shell triple-quote #201

alpha-beta-soup opened this issue Sep 17, 2023 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@alpha-beta-soup
Copy link

  rule archive:
+     input:
-     input: FOOTPRINT
?     ^^^^^^
+         FOOTPRINT,
?     ^^^          +
-     output: ARCHIVE
?            --------
+     output:
+         ARCHIVE,
-     shell: '''
?           ----
+     shell:
+         """
          mkdir -p $(dirname {output})
          zip -r {output} './data'
-     '''
+     """

That is,

shell: '''
    some-command {output} {input}
'''

Is formatted to:

shell:
    """
    some-command {output} {input}
"""

However the newline loses the syntax highlighting in VS Code, at least with my current settings:

Before:
Screenshot from 2023-09-18 11-40-28

After:
Screenshot from 2023-09-18 11-40-47

I'd be interested in either learning how to disable that change, or perhaps just knowing what I could tweak in VS Code to continue to see {output} etc with string-format syntax-highlighting, as this is really quite useful for more complex rules.

@alpha-beta-soup alpha-beta-soup changed the title Prevnet newline for shell triple-quote Prevent newline for shell triple-quote Sep 17, 2023
@mbhall88
Copy link
Member

You can't disable this change from snakefmt. I suspect your issue may have something to do with VS Code? But I can't help you there as I don't use VS Code sorry. I'll leave this open and hopefully someone else who uses it can shed some light....

@mbhall88 mbhall88 added the help wanted Extra attention is needed label Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants