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

Method partMatches

internal/check/scope.go:62–76  ·  view source on GitHub ↗
(target, parent Selector, options []Selector)

Source from the content-addressed store, hash-verified

60}
61
62func (s Scope) partMatches(target, parent Selector, options []Selector) bool {
63 for _, part := range options {
64 tm := target.Contains(part)
65 pm := parent.Contains(part)
66 if part.Negated && !pm {
67 if target.Has("raw") || target.Has("summary") {
68 // This can't apply to sized scopes.
69 return false
70 }
71 } else if (!part.Negated && !tm) || (part.Negated && pm) {
72 return false
73 }
74 }
75 return true
76}
77
78// Sections splits a Selector into its parts -- e.g., text.comment.line.py ->
79// []string{"text", "comment", "line", "py"}.

Callers 1

MatchesMethod · 0.95

Calls 2

ContainsMethod · 0.80
HasMethod · 0.80

Tested by

no test coverage detected