Requirements: if-then for source matcher
Open
enhancement
- Dominant language
- Haskell
- Stars
- 1.3k
- Forks
- 201
- PR merge metrics
- No merged PRs in 30d
Description
The only requirements-checker rule that currently uses the source matcher is `containsMatch`. This rule requires that some declaration in the file matches the target. Another useful pattern could be to require that any declaration that matches the first pattern must *also* match the second. For example, one could write:
ifMatch:
condition: |
foo = $any
template: |
foo = $var $(tupleOf [| $any |])
This would say that if `foo` is defined, then its definition must look like a function applied to a tuple.
Contributor guide
Assessment
This issue has not been assessed yet.