snakefmt
snakefmt copied to clipboard
edge case: shell cmd prefix
We use some... unconventional... syntax in several rules. This may not even be worth your attention, but FYI.
minimal example:
rule break_snakefmt_044:
shell:
("conditional prefix" if True else "") +
"""\
cmd
"""
error:
snakefmt.exceptions.InvalidPython: Got error:
'''
Cannot parse: 1:40: ("conditional prefix" if True else "") +
'''
while formatting code with black.
P.S. This was the last issue I found while formatting our code 🎉
Similar problem:
rule:
input:
"input.ext"
output:
"output.ext"
shell:
get_cmd(config, "command")
"--arg test"
snakefmt.exceptions.InvalidParameterSyntax: 31get_cmd(config, "command")
"--arg test"