google / google/codeworld

Requirements: if-then for source matcher

Open
#791 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.