matcher

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StandardExclusions = []string{

	"!.Rproj.user/",
	"!.git/",
	"!.svn/",
	"!__pycache__/",
	"!packrat/",
	"!rsconnect-python/",
	"!rsconnect/",

	"!.DS_Store",
	"!.Rhistory",
	"!.quarto/",

	"!*_cache/",

	"!.ipynb_checkpoints/",

	"!manifest.json",

	"!renv/library",
	"!renv/sandbox",
	"!renv/staging",

	"!node_modules/",
}

Functions

func NewMatchList

func NewMatchList(base util.AbsolutePath, builtins []string) (*defaultMatchList, error)

func NewMatchingWalker

func NewMatchingWalker(configuredMatches []string, dir util.AbsolutePath, log logging.Logger) (util.Walker, error)

NewMatchingWalker returns a Walker that only iterates over matching files and directories. All files are included, except exclusions sourced from the built-in exclusion list and Python environment directories.

Types

type MatchFile

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

func NewBuiltinMatchFile

func NewBuiltinMatchFile(base util.AbsolutePath, patternStrings []string) (*MatchFile, error)

func NewMatchFile

func NewMatchFile(base util.AbsolutePath, filePath util.AbsolutePath, patternStrings []string) (*MatchFile, error)

func (*MatchFile) Match

func (f *MatchFile) Match(filePath string) *Pattern

type MatchList

type MatchList interface {
	AddFromFile(base util.AbsolutePath, filePath util.AbsolutePath, patterns []string) error
	Match(path util.AbsolutePath) *Pattern
}

type MatchSource

type MatchSource string
const MatchSourceBuiltIn MatchSource = "built-in"
const MatchSourceFile MatchSource = "file"
const MatchSourcePermissionsError MatchSource = "permissions"

type MockMatchList

type MockMatchList struct {
	mock.Mock
}

func (*MockMatchList) AddFromFile

func (m *MockMatchList) AddFromFile(base util.AbsolutePath, filePath util.AbsolutePath, patterns []string) error

func (*MockMatchList) Match

func (m *MockMatchList) Match(path util.AbsolutePath) *Pattern

type Pattern

type Pattern struct {
	Source   MatchSource       `json:"source"`   // type of match, e.g. file or a caller-provided value
	Pattern  string            `json:"pattern"`  // exclusion pattern as read from the file
	Exclude  bool              `json:"exclude"`  // true if this pattern un-matches a file
	FileName string            `json:"fileName"` // name of the file where this was defined, empty if not from a file
	FilePath util.AbsolutePath `json:"filePath"` // path to the file where this was defined, empty if not from a file
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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