rules

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultExcludes

func DefaultExcludes() []types.Rule

func NewBinaryRule added in v0.2.3

func NewBinaryRule() types.Rule

func NewEcosystemRule added in v0.4.1

func NewEcosystemRule(rootPath string) types.Rule

NewEcosystemRule creates an ecosystem-aware lock file detector

func NewExtensionRule

func NewExtensionRule(exts []string, action types.RuleAction) types.Rule

func NewGeneratedFileRule added in v0.4.1

func NewGeneratedFileRule(sizeThresholdMB int64) types.Rule

func NewLockFileRule added in v0.4.1

func NewLockFileRule() types.Rule

func NewPatternRule

func NewPatternRule(patterns []string, action types.RuleAction) types.Rule

Types

type BaseRule

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

BaseRule provides common functionality

func (*BaseRule) Action

func (r *BaseRule) Action() RuleAction

type BinaryRule added in v0.2.3

type BinaryRule struct {
	types.BaseRule
}

func (*BinaryRule) Match added in v0.2.3

func (r *BinaryRule) Match(path string) bool

Match checks if a file is binary using a three-stage approach for optimal performance: 1. Extension check (fastest - O(1) map lookup, no I/O) 2. File size check (fast - single stat call, no content read) 3. Content analysis (slowest - reads file content as last resort)

type EcosystemRule added in v0.4.1

type EcosystemRule struct {
	types.BaseRule
	// contains filtered or unexported fields
}

EcosystemRule detects and excludes lock files based on detected package managers

func (*EcosystemRule) Match added in v0.4.1

func (er *EcosystemRule) Match(path string) bool

Match checks if a file is a lock file for any detected ecosystem

type ExtensionRule

type ExtensionRule struct {
	types.BaseRule
	// contains filtered or unexported fields
}

func (*ExtensionRule) Match

func (r *ExtensionRule) Match(path string) bool

type GeneratedFileRule added in v0.4.1

type GeneratedFileRule struct {
	types.BaseRule
	// contains filtered or unexported fields
}

func (*GeneratedFileRule) Match added in v0.4.1

func (r *GeneratedFileRule) Match(path string) bool

type LockFileRule added in v0.4.1

type LockFileRule struct {
	types.BaseRule
}

func (*LockFileRule) Match added in v0.4.1

func (r *LockFileRule) Match(path string) bool

type PatternRule

type PatternRule struct {
	types.BaseRule
	// contains filtered or unexported fields
}

func (*PatternRule) Match

func (r *PatternRule) Match(path string) bool

func (*PatternRule) Patterns

func (r *PatternRule) Patterns() []string

type Rule

type Rule interface {
	Match(path string) bool
	Action() RuleAction
}

type RuleAction

type RuleAction int
const (
	Include RuleAction = iota
	Exclude
	Skip
)

Jump to

Keyboard shortcuts

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