diff --git a/snakemake/parser.py b/snakemake/parser.py index a293b013b..521d3c8c0 100644 --- a/snakemake/parser.py +++ b/snakemake/parser.py @@ -955,11 +955,12 @@ def end(self): ) yield "\n" - # yield with block - yield from self._with_block + if self._with_block: + # yield with block + yield from self._with_block - yield "@workflow.run" - yield "\n" + yield "@workflow.run" + yield "\n" rulename = self.rules[0] if rulename == "*": diff --git a/tests/test_modules_all/module-test/Snakefile b/tests/test_modules_all/module-test/Snakefile index 1d4cb5d4e..9a95fd324 100644 --- a/tests/test_modules_all/module-test/Snakefile +++ b/tests/test_modules_all/module-test/Snakefile @@ -5,8 +5,13 @@ def some_func(): return 15 +rule all: + input: + "results/test.out" + + rule a: output: "results/test.out" shell: - "echo {config[test]} > {output}" \ No newline at end of file + "echo {config[test]} > {output}"