snakefmt
snakefmt copied to clipboard
Decorated functions lead to error
trafficstars
import contextlib
@contextlib.contextmanager
def some_helper():
pass
produces
snakefmt.exceptions.InvalidPython: Got error:
Cannot parse: 41:1: @
while formatting code with black.
Hi @holtgrewe I can't seem to replicate this with the latest snakefmt (v0.6.0)
$ singularity exec "docker://quay.io/biocontainers/snakefmt:0.6.0--pyhdfd78af_0" snakefmt --diff - << '@'
import contextlib
@contextlib.contextmanager
def some_helper():
pass
@
=====> Diff for stdin <=====
import contextlib
+
@contextlib.contextmanager
def some_helper():
pass
[INFO] All done 🎉
Sorry, the following MWE is better.
# singularity exec "docker://quay.io/biocontainers/snakefmt:0.6.0--pyhdfd78af_0" snakefmt --diff - << '@'
rule run_varfish_annotator:
run:
print("")
@contextlib.contextmanager
def tmp_with_varfishrc(wildcards):
pass
@
INFO: Using cached SIF image
snakefmt.exceptions.InvalidPython: Got error:
Cannot parse: 4:1: @
while formatting code with black.
Thanks @holtgrewe I can recreate now.
We'll take a look at this after #136 is finished
@mbhall88 i'll give that review a go in the next week or so