-
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 adds wrong indentation #124
Comments
This is the full rule:
|
The part with the if config else is moved to the left. |
I think this is potentially connected to #115. I'm pretty vague on how the if-else parsing works. @bricoletc might be better able to figure this out. |
Apologies I've got low bandwith at the moment, with my last year of thesis, (and @mbhall88 is defending his!) however i will take a look at it in the next few weeks |
This also happens with nesting outside (but in combination with) rules. Here is a minimal example: if True:
def func1():
"""this function will stay indented"""
pass
rule break_snakefmt_044:
shell: ""
def func2():
"""this function will be unindented"""
pass |
I think this label could get a |
Feel free to tackle this @corneliusroemer. It has been bugging me too. I'm still trying to figure out a couple of issues on #151 and then I was going to try and tackle this. But feel free to have a go 👍 |
I wonder if anyone would like to test out #164 as that fixes the two examples in this issue? |
* Bugfix: Hard-coded tab length * Bugfix: indent level passed to black str formatting * Refactor: 'after_if' testing
It looks like
snakefmt 0.4.4
adds wrong indentations when formatting a snakemake rule containing a if-else-closure.As an example the following output will be created for a proper formatted rule:
A minimal example is attached.
Snakefile.zip
The text was updated successfully, but these errors were encountered: