snakefmt
snakefmt copied to clipboard
The uncompromising Snakemake code formatter
Introduced by https://github.com/snakemake/snakemake/pull/1717
Take this input as an example, by running snakefmt, the indent will be wrong. ```yaml rule cutadapt: input: "a.txt" output: "b.txt" run: if ( "xxxxxxxxxxxxxxxxxxxxxx" not in wildcards.rn and "yyyyyyyyyyyyyyyyyyyyyyyyyy"...
Addresses #123 and #149
I just applied `snakefmt` to nextstrain/monkeypox. While I love the idea of a snakemake formatter and you've done a great job, the result for our main Snakefile is a bit...
snakefmt v0.4.0 reformats this rule: ``` rule one: output: out_file="out.txt", shell: r""" cat
Not sure if this has been discussed elsewhere, but is there an official order that the different directives should be written? And if there is would it be possible to...
``` import contextlib @contextlib.contextmanager def some_helper(): pass ``` produces ``` snakefmt.exceptions.InvalidPython: Got error: ``` Cannot parse: 41:1: @ ``` while formatting code with black. ```
We use some... unconventional... syntax in several rules. This may not even be worth your attention, but FYI. minimal example: ```python rule break_snakefmt_044: shell: ("conditional prefix" if True else "")...
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:...
When a parameter_list contains a empty named entry it is deleted by snakefmt upon formatting if there are other entries. Somewhat related to #104. ``` rule foo: input: bar="fileA.data", baz=...