ignore

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ExampleBase = `#.dotatoignore
**/*dotato*
**/README.md
`
View Source
const ExampleGroup = `#.dotatoignore
*
!.bashrc
# !my-dir
# !.my-file
`

Variables

This section is empty.

Functions

func GetBaseFrom

func GetBaseFrom(dir gp.GardenPath) int

Types

type Ignore

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

Ignore wraps RuleTree and implements file read.

func New

func New(base gp.GardenPath, ignoreFileName string) *Ignore

Create an Ignore instance.

func NewWithFS

func NewWithFS(fs billy.Filesystem, base gp.GardenPath, ignoreFileName string) *Ignore

func (Ignore) IsIgnored

func (i Ignore) IsIgnored(path gp.GardenPath) bool

func (Ignore) IsIgnoredWithBaseDir

func (i Ignore) IsIgnoredWithBaseDir(baseDir gp.GardenPath, path gp.GardenPath) bool

func (Ignore) Read

func (i Ignore) Read(dir gp.GardenPath) (bool, error)

Read the ignore file in the given directory.

func (Ignore) ReadRecur

func (i Ignore) ReadRecur(dir gp.GardenPath) error

Read the ignore file in the given directory and all its subdirectories.

type RuleTree

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

func (*RuleTree) Append

func (t *RuleTree) Append(dir gp.GardenPath, rules *Rules)

Add rules to the tree at the given dir.

This function overwrites the existing rules.

If dir is nil, it will do nothing.

func (RuleTree) IsIgnored

func (t RuleTree) IsIgnored(path gp.GardenPath) bool

func (RuleTree) IsIgnoredWithBase

func (t RuleTree) IsIgnoredWithBase(base int, path gp.GardenPath) bool

func (RuleTree) IsIgnoredWithBaseDir

func (t RuleTree) IsIgnoredWithBaseDir(baseDir gp.GardenPath, path gp.GardenPath) bool

Use base from the given dir.

func (*RuleTree) SetBase

func (t *RuleTree) SetBase(base int)

func (*RuleTree) SetBaseFromDir

func (t *RuleTree) SetBaseFromDir(dir gp.GardenPath)

type Rules

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

A wrapper of external gitignore package.

func (Rules) IsIgnored

func (r Rules) IsIgnored(relPath string) bool

Ignore rule works with relative path.

Jump to

Keyboard shortcuts

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