Closed GianlucaFicarelli closed 10 months ago
Could you please post an example before formatting?
Could you please post an example before formatting?
Sure, the content before formatting can be the already formatted code as in the second snippet, that will be "unformatted" after processing it.
Here is the corresponding Snakefile that can be used as input:
rule test1:
input:
"...",
output:
"...",
shell:
myfunc(
"param1",
[
"item1",
f"very_long_item2_{very_long_function(other_param)}"
if some_very_long_condition
else "",
],
)
rule test2:
input:
"...",
output:
"...",
shell:
myfunc(
"param1",
[
"item1",
f"very_long_item2_{very_long_function(other_param)}"
if some_very_long_condition
else "",
"item10",
"item11",
"item12",
]
+ [
f"sub_{item}"
for item in [
"item2",
"item3",
]
],
)
rule test3:
input:
"...",
output:
"...",
shell:
myfunc(
"item1",
[
"sub_item1",
"sub_item2"
if some_very_very_very_very_very_very_very_very_long_condition
else "sub_item3",
"sub_item4",
],
)
This is fixed in v0.9.0
Hello, I get some unexpected formatting when using the current versions:
See these examples, produced after calling
snakefmt Snakefile
:For comparison, the same function calls, indented at the same level and formatted with black, are:
Instead, the format is correct when using these old versions: