MCPcopy Create free account
hub / github.com/vale-cli/vale / hasCaptureGroup

Function hasCaptureGroup

internal/check/conditional.go:34–38  ·  view source on GitHub ↗

hasCaptureGroup reports whether `pattern` contains a capturing group -- an unescaped `(` that doesn't begin a non-capturing/extension group `(?...)`.

(pattern string)

Source from the content-addressed store, hash-verified

32// hasCaptureGroup reports whether `pattern` contains a capturing group -- an
33// unescaped `(` that doesn't begin a non-capturing/extension group `(?...)`.
34func hasCaptureGroup(pattern string) bool {
35 opens := strings.Count(pattern, "(")
36 noncap := strings.Count(pattern, "(?") + strings.Count(pattern, `\(`)
37 return opens > noncap
38}
39
40// NewConditional creates a new `conditional`-based rule.
41func NewConditional(cfg *core.Config, generic baseCheck, path string) (Conditional, error) {

Callers 1

NewConditionalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…