filter

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeAndDedupePatterns

func MergeAndDedupePatterns(patterns ...[]string) []string

MergeAndDedupePatterns combines and deduplicates patterns

func ParseGitIgnore

func ParseGitIgnore(rootDir string) ([]string, error)

ParseGitIgnore reads .gitignore file and returns patterns

Types

type FileTypeInfo added in v0.2.6

type FileTypeInfo struct {
	Type         string // Primary type (e.g., source, config, doc)
	Category     string // Specific category (e.g., go-source, yaml-config)
	IsTest       bool   // Whether it's a test file
	IsEntryPoint bool   // Whether it's an entry point
	Size         int64  // File size in bytes
}

FileTypeInfo contains detailed information about a file's type and category

func GetFileType

func GetFileType(path string, f *Filter) FileTypeInfo

GetFileType determines detailed type information for a file

type Filter

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

func New

func New(opts Options) *Filter

func (*Filter) IsExcluded

func (f *Filter) IsExcluded(path string) bool

IsExcluded checks if a path is explicitly excluded

func (*Filter) ShouldProcess

func (f *Filter) ShouldProcess(path string) bool

ShouldProcess determines if a path should be processed

type Options

type Options struct {
	Includes        []string
	Excludes        []string
	UseDefaultRules bool // Controls whether to apply default filtering rules
	UseGitIgnore    bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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