cloudflare/pint
Publicmirrored from https://github.com/cloudflare/pintAvailable
internal/config/ci.go
19lines · modecode
| 1 | package config |
| 2 | |
| 3 | import "regexp" |
| 4 | |
| 5 | type CI struct { |
| 6 | Include []string `hcl:"include,optional"` |
| 7 | MaxCommits int `hcl:"maxCommits,optional"` |
| 8 | BaseBranch string `hcl:"baseBranch,optional"` |
| 9 | } |
| 10 | |
| 11 | func (ci CI) validate() error { |
| 12 | for _, pattern := range ci.Include { |
| 13 | _, err := regexp.Compile(pattern) |
| 14 | if err != nil { |
| 15 | return err |
| 16 | } |
| 17 | } |
| 18 | return nil |
| 19 | } |
| 20 | |