-
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
Incorrect shell indenting with snakefmt 0.8.2 and black 23.1.0 #186
Labels
bug
Something isn't working
Comments
Could you please post an example before formatting? |
mbhall88
changed the title
Incorrect format with snakefmt 0.8.2 and black 23.1.0
Incorrect shell indenting with snakefmt 0.8.2 and black 23.1.0
Mar 15, 2023
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 |
bricoletc
added a commit
to bricoletc/snakefmt
that referenced
this issue
Jan 31, 2024
mbhall88
pushed a commit
that referenced
this issue
Jan 31, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
The text was updated successfully, but these errors were encountered: