(original issue: snakemake/snakefmt#283)
Is your feature request related to a problem? Please describe.
Using pathvars might introduce issues if devs are not pristine in how they add them to rules.
For example, if you forget to add <resources>/... to just one rule input, you'll end up with a file placed outside of wherever you re-route <resources> to.
This is often hard to track in large enough workflows.
Describe the solution you'd like
It'd be nice to have a linting option that tests that all rules in a workflow make use of pathvars, at least for <resources>, <logs>, and <results>.
Additionally, it'd also be useful to check that custom pathvars also respect default pathvars to avoid anti-patterns
Suggested checks:
- all rule logs, inputs, outputs and benchmarks start with their equivalent
<> default (e.g., inputs start with <resources>) or a custom alternative (e.g., an input could be <user_shapes>).
- Custom pathvar defaults respect generic pathvars via nesting (so that if they are unspecified, their default respects them)
pathvars:
# will still respect the 'resources' pathvar if not specified
user_shapes="<resources>/user/{shapes}/shapes.parquet",
Describe alternatives you've considered
Lots of visual inspection, I suppose?
Additional context
None
(original issue: snakemake/snakefmt#283)
Is your feature request related to a problem? Please describe.
Using
pathvarsmight introduce issues if devs are not pristine in how they add them to rules.For example, if you forget to add
<resources>/...to just one rule input, you'll end up with a file placed outside of wherever you re-route<resources>to.This is often hard to track in large enough workflows.
Describe the solution you'd like
It'd be nice to have a linting option that tests that all rules in a workflow make use of
pathvars, at least for<resources>,<logs>, and<results>.Additionally, it'd also be useful to check that custom
pathvarsalso respect defaultpathvarsto avoid anti-patternsSuggested checks:
<>default (e.g., inputs start with<resources>) or a custom alternative (e.g., an input could be<user_shapes>).Describe alternatives you've considered
Lots of visual inspection, I suppose?
Additional context
None