-
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
Else branch after conditional include breaks depending on subsequent code #239
Comments
Just ran into a similar, but slightly different variant of this while trying to format another file. Minimal example: if condition_1:
include: "rule_1.smk"
elif condition_2:
pass
else:
raise Exception("Invalid conditions") Fails with
Here, removing either the if condition_1:
include: "rule_1.smk"
elif condition_2:
include: "dummy.smk"
else:
raise Exception("Invalid conditions") This works. |
Oh, very weird. I'll take a look soon hopefully. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think this is a regression of #115, or an extension of the issue reported there.
Minimal example, using snakefmt v0.10.2:
The error is:
Removing the second conditional part however solves this, despite that part not having anything to do with the condition that causes the problem.
My current workaround is to rewrite the
else
branch asbut since in my actual code I have a few
elif
befor that, this is quite cumbersome.The text was updated successfully, but these errors were encountered: