Skip to content

Commit

Permalink
fix: fix false complaints about rules with multiple output files (#2628)
Browse files Browse the repository at this point in the history
### Description

<!--Add a description of your PR here-->

### QC
<!-- Make sure that you can tick the boxes below. -->

* [ ] The PR contains a test case for the changes or the changes are
already covered by an existing test case.
* [ ] The documentation (`docs/`) is updated to reflect the changes or
this is not necessary (e.g. if the change does neither modify the
language nor the behavior or functionalities of Snakemake).
  • Loading branch information
johanneskoester committed Jan 17, 2024
1 parent f7edb9f commit b1b4f5b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions snakemake/rules.py
Expand Up @@ -198,7 +198,7 @@ def is_run(self):
)

def check_caching(self):
if self.name in self.workflow.cache_rules:
if self.workflow.cache_rules.get(self.name):
if len(self.output) == 0:
raise RuleException(
"Rules without output files cannot be cached.", rule=self
Expand All @@ -207,7 +207,8 @@ def check_caching(self):
prefixes = set(out.multiext_prefix for out in self.output)
if None in prefixes or len(prefixes) > 1:
raise RuleException(
"Rules with multiple output files must define them as a single multiext() "
"Rules marked as eligible for caching that have with multiple "
"output files must define them as a single multiext() "
'(e.g. multiext("path/to/index", ".bwt", ".ann")). '
"The rationale is that multiple output files can only be unambiously resolved "
"if they can be distinguished by a fixed set of extensions (i.e. mime types).",
Expand Down

0 comments on commit b1b4f5b

Please sign in to comment.