Skip to content
Permalink
Browse files
fix: check for skipped rules in case of local rule inheritance (#1631)
  • Loading branch information
johanneskoester committed May 4, 2022
1 parent 42fc9de commit 9083ac1f40daf3d284ce9b1ac2d4addde9b5b258
Showing 1 changed file with 8 additions and 1 deletion.
@@ -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),
lineno=lineno,
snakefile=snakefile,
)
rule = Rule(name, self, lineno=lineno, snakefile=snakefile)
self._rules[rule.name] = rule
@@ -1925,6 +1927,11 @@ def decorate(maybe_ruleinfo):
)
else:
# 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.
return

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."

0 comments on commit 9083ac1

Please sign in to comment.