Skip to content


Browse files Browse the repository at this point in the history
fix: check for skipped rules in case of local rule inheritance (#1631)
  • Loading branch information
johanneskoester committed May 4, 2022
1 parent 42fc9de commit 9083ac1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion snakemake/
Expand Up @@ -474,7 +474,9 @@ def add_rule(
is_overwrite = self.is_rule(name)
if not allow_overwrite and is_overwrite:
raise CreateRuleException(
"The name {} is already used by another rule".format(name)
"The name {} is already used by another rule".format(name),
rule = Rule(name, self, lineno=lineno, snakefile=snakefile)
self._rules[] = rule
Expand Down Expand Up @@ -1925,6 +1927,11 @@ def decorate(maybe_ruleinfo):
# local inheritance
if self.modifier.skip_rule(name_modifier):
# The parent use rule statement is specific for a different particular rule
# hence this local use rule statement can be skipped.

if len(rules) > 1:
raise WorkflowError(
"'use rule' statement from rule in the same module must declare a single rule but multiple rules are declared."
Expand Down

0 comments on commit 9083ac1

Please sign in to comment.