ignore

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const IgnoreFile = ".multignore"

IgnoreFile is the name of the ignore file.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRule

type BaseRule string

BaseRule matches the base of the path.

func (BaseRule) Match

func (r BaseRule) Match(name string) (bool, error)

Match returns true if the path matches.

type EmptyRule

type EmptyRule string

EmptyRule never matches.

func (EmptyRule) Match

func (r EmptyRule) Match(name string) (bool, error)

Match returns true if the path matches.

type Filter

type Filter []Rule

Filter is a list of paths to ignore.

func Load

func Load(dir string) (Filter, error)

Load returns the ignore filter from the given directory.

func New

func New(dir string, patterns ...string) Filter

New returns a new ignore filter.

func (Filter) Match

func (f Filter) Match(name string) bool

Match returns true if the path matches any ignore rules.

func (Filter) Merge

func (f Filter) Merge(other Filter) Filter

Merge combines the ignore rules with the other ignore.

type NegateRule

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

NegateRule negates a rule.

func (NegateRule) Match

func (r NegateRule) Match(name string) (bool, error)

Match returns true if the path matches.

type PathRule

type PathRule string

PathRule matches the entire path.

func (PathRule) Match

func (r PathRule) Match(name string) (bool, error)

Match returns true if the path matches.

type Rule

type Rule interface {
	// Match returns true if the path matches.
	Match(string) (bool, error)
}

Rule is used to match file paths.

func ParseRule

func ParseRule(dir, pattern string) Rule

ParseRule returns a rule for the given pattern.

Jump to

Keyboard shortcuts

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