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

Method Matches

internal/check/scope.go:49–60  ·  view source on GitHub ↗

Macthes the scope `s` matches `s2`.

(blk nlp.Block)

Source from the content-addressed store, hash-verified

47
48// Macthes the scope `s` matches `s2`.
49func (s Scope) Matches(blk nlp.Block) bool {
50 candidate := NewSelector(strings.Split(blk.Scope, "."))
51 parent := NewSelector(strings.Split(blk.Parent, "."))
52
53 for _, sel := range s.Selectors {
54 if s.partMatches(candidate, parent, sel) {
55 return true
56 }
57 }
58
59 return false
60}
61
62func (s Scope) partMatches(target, parent Selector, options []Selector) bool {
63 for _, part := range options {

Callers 2

shouldRunMethod · 0.95
lintMetadataMethod · 0.95

Calls 2

partMatchesMethod · 0.95
NewSelectorFunction · 0.85

Tested by

no test coverage detected