snakemake / snakemake

This is the development home of the workflow management system Snakemake. For general information, see
https://snakemake.github.io
MIT License
2.17k stars 521 forks source link

More descriptive error message for AmbiguousRuleException and update Documentation: Ruleorder #2893

Open KasperThystrup opened 1 month ago

KasperThystrup commented 1 month ago

Is your feature request related to a problem? Please describe. When getting this error, the current error states

Consider starting rule output with a unique prefix, constrain your wildcards, or use the ruleorder directive.

My first instict would be to add the ruleorder directive under the involved rules. Unfortunately this yields a SyntaxError

Unexpected keyword ruleorder in rule definition

Describe the solution you'd like When looking up ruleorder in the documentation it is not clearly stated that it's supposed to be placed outside the rule defination. Consider tweaking the AmbiguousRuleException message, so that it's specified to define the ruleorder at top level. Definately make sure to update the documentation on that ruleorder should be placed outside the rule.

Describe alternatives you've considered More coding heavy: Make a ruleorder exception for the rules, which detects the ruleorder keyword, and thus provides a specific error message on its usage.