Documentation
¶
Index ¶
- type Matcher
- func (m *Matcher) GetMatchedGuides(patterns []config.Pattern, isDiff bool) []string
- func (m *Matcher) MatchFile(filename string) ([]config.Pattern, error)
- func (m *Matcher) MatchFileContent(filename string, content []byte) ([]config.Pattern, error)
- func (m *Matcher) ScanFile(filename string) ([]config.Pattern, error)
- func (m *Matcher) ScanFileLines(filename string, maxLines int) ([]config.Pattern, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher handles pattern matching for files and content based on configuration rules. It caches compiled regular expressions for performance and supports multiple matching strategies.
func NewMatcher ¶
NewMatcher creates a new matcher with the given configuration. The matcher will use the provided config to determine matching rules and strategies.
func (*Matcher) GetMatchedGuides ¶
GetMatchedGuides returns the appropriate guide files for the given matched patterns. Uses diff_context guides if isDiff is true, otherwise uses regular context guides.
func (*Matcher) MatchFile ¶
MatchFile determines which patterns match a given filename. Only evaluates filename-based patterns, not content patterns.
func (*Matcher) MatchFileContent ¶
MatchFileContent determines which patterns match based on both filename and file content. Evaluates all patterns and applies the appropriate content scanning strategy for each.