From d2223d41dfba057ab735395eac8339c27866c2ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20K=C3=B6ster?= Date: Tue, 5 Apr 2022 12:35:35 +0200 Subject: [PATCH] fix: fixed detection of norun rules inside of modules (#1566) --- snakemake/parser.py | 9 +++++---- tests/test_modules_all/module-test/Snakefile | 7 ++++++- 2 files changed, 11 insertions(+), 5 deletions(-) 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}"