Formatter mess up if-else statements indention
See original GitHub issueTake this input as an example, by running snakefmt, the indent will be wrong.
rule cutadapt:
input:
"a.txt"
output:
"b.txt"
run:
if (
"xxxxxxxxxxxxxxxxxxxxxx" not in wildcards.rn
and "yyyyyyyyyyyyyyyyyyyyyyyyyy" not in wildcards.rn
):
shell(
"""
cutadapt \
-m 30 \
{input} \
-o {output}
"""
)
else:
shell(
"""
cutadapt \
{input} \
-o {output}
"""
)
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Indentation of an IF-ELSE block in Python - Stack Overflow
The accepted answer is showing an example that the else statement must be indented at the same level as the if statement-- and...
Read more >If-Else statements auto-indent with each else statement #5396
The AL Formatter formats if-else statements by increasing the indentation for each case. This results in e.g. nested statements to confuse those ...
Read more >What is the formatting for if/else statements? (Semicolons and ...
i have a question on the if…else statement …why we didn't put a semi-colon after the code block of else statement for example:...
Read more >Indentation Error in Python | How to Solve it - Edureka
This article will provide you with a detailed understanding of Indentation error in Python and the solutions to avoid the same.
Read more >Python Indentation - W3Schools
Python Indentation. Indentation refers to the spaces at the beginning of a code line. Where in other programming languages the indentation in code...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is not related to #151 in the end. Its a bit trickier. Leave it with me and I’ll try get to the bottom of it soon.
This will be fixed in the next release