-
Notifications
You must be signed in to change notification settings - Fork 29
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
snakefmt issue related to black #118
Comments
is missing a space between the |
Yes, at some point the '\n' is converted into empty string rather than a space, so if there is some multi-line comprehension statement, then snakefmt will raise the error. Possibly here, but not sure. This issue is not present in |
@fgypas the @SultanOrazbayev if you could provide a minimal example recreating this it would be very helpful thanks. |
Hi @mbhall88 Sorry we moved the pipeline to github. Here is what I tried to do with git clone -b dev https://github.com/zavolanlab/zarp.git
git checkout eb398b06e68c52009b1fcb0a8903cc395103b795 Then I run twice snakefmt in the workflow directory.
In the first case it formats the code fine:
In the second case it throws an error:
Please let me know if you can also reproduce this. |
Thanks a lot @mbhall88 for this fix . I will wait then for #121 to be fixed as well. Regarding #121 I also observed this and I was not sure if it's a bug or I was doing something wrong when using the single In another pipeline I switched to triple
|
Yeah, using single quotes the way you were is a little cumbersome and triple quotes are far more ergonomic, however, syntax-wise they are perfectly valid and we shouldn't have been indenting them as we are. |
I think I may have an example of this error: rule test:
input:
expand("{accession}/blah.fasta", accession=config["accessions"] if type(config["accessions"]) == list else config["accessions"].split(","))
output:
"test.fasta",
shell:
"cat {input} > {output}" Running snakefmt on this works and gives me: rule test:
input:
expand(
"{accession}/blah.fasta",
accession=config["accessions"]
if type(config["accessions"]) == list
else config["accessions"].split(","),
),
output:
"test.fasta",
shell:
"cat {input} > {output}" However, running snakefmt on that errors with:
|
@Benjamin-Lee could you try out the tip of |
For me the |
#121 is fixed and merged in, closing this! |
Hi
I run into another issue (after #112) when running snakefmt (0.4.2). To get the error please try the following:
When I run:
snakefmt --diff workflow/
I get the following error:
Do you know why this happens?
Thank you in advance for your help.
The text was updated successfully, but these errors were encountered: