-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Update Snakemake language config #11936
base: master
Are you sure you want to change the base?
Conversation
Updated the Snkaemake `file-types` argument to properly detect the language for Snakefile.
call `snakefmt -` to pass stdin to the snakefmt and receive the output through stdout.
comment-tokens = ["#", "##"] | ||
indent = { tab-width = 2, unit = " " } | ||
language-servers = ["pylsp" ] | ||
|
||
[language.formatter] | ||
command = "snakefmt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Snakefmt is the formatter provided by the Snakemake Github organisation: https://github.com/snakemake/snakefmt
comment-tokens = ["#", "##"] | ||
indent = { tab-width = 2, unit = " " } | ||
language-servers = ["pylsp" ] | ||
|
||
[language.formatter] | ||
command = "snakefmt" | ||
args = ["-"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was not so clearly documented, but in the warning callout at the start of the Github Readme, they state:
You can also pipe the file in from stdin, which will print it to the screen.
Later, in the last example of Basic Usage they show how to write the output to stdout with
snakefmt - < Snakefile
It turns out, that by removing the < Snakefile
part above, snakefmt
takes input from stdin and sends the output to stdout.
@@ -3840,11 +3840,14 @@ source = { git = "https://github.com/Decurity/tree-sitter-circom", rev = "021505 | |||
name = "snakemake" | |||
scope = "source.snakemake" | |||
roots = ["Snakefile", "config.yaml", "environment.yaml", "workflow/"] | |||
file-types = ["smk", "Snakefile"] | |||
file-types = ["smk", { glob = "Snakefile" } ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the original commit, "Sankefile" was handled as a suffix, when instead Helix should look at the full filename to apply the language. Like Make
and Makefile
, the Snakemake
pipeline is defined in Snakefile
. I added the required glob
part.
@pascalkuthe, sorry to bother you, but I saw that you reviewed the original Snakemake PR. Could you check this one too, or assign someone for the review? Thank you! |
file-types
argument in Snakemake language definition to properly detect the language forSnakefile
.snakefmt
.