matchers

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package matchers provides framework-specific detection rules.

Index

Constants

View Source
const (
	PriorityGeneric     = 100 // jest, go-testing
	PriorityE2E         = 150 // playwright
	PrioritySpecialized = 200 // vitest (has specific globals mode)
)

Priority determines detection order when multiple frameworks could match. Higher values = checked first. Use increments of 50 for future insertions.

Variables

This section is empty.

Functions

func Register

func Register(m Matcher)

Types

type ConfigInfo added in v1.1.1

type ConfigInfo struct {
	Framework   string
	GlobalsMode bool
}

type Matcher

type Matcher interface {
	Name() string
	Languages() []domain.Language
	MatchImport(importPath string) bool
	ConfigPatterns() []string
	ExtractImports(ctx context.Context, content []byte) []string
	ParseConfig(content []byte) *ConfigInfo
	Priority() int
}

Matcher defines the interface for framework-specific detection.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func DefaultRegistry

func DefaultRegistry() *Registry

func NewRegistry

func NewRegistry() *Registry

func (*Registry) All

func (r *Registry) All() []Matcher

func (*Registry) Clear

func (r *Registry) Clear()

func (*Registry) FindByImport

func (r *Registry) FindByImport(importPath string) (Matcher, bool)

func (*Registry) FindByLanguage

func (r *Registry) FindByLanguage(lang domain.Language) []Matcher

func (*Registry) FindByName

func (r *Registry) FindByName(name string) (Matcher, bool)

func (*Registry) Register

func (r *Registry) Register(m Matcher)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL