ignorerules

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package ignorerules applies .gitignore, .ignore, and .fdignore files the way upstream Pi's package manager does when it discovers package resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ignored

func Ignored(candidate string, directory bool, root string, rules []Rule) bool

Ignored reports whether candidate, relative to root, is excluded by rules. As in the `ignore` package, a path inside an ignored directory is ignored; a rule can not re-include it.

Types

type Rule

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

Rule is one pattern from a .gitignore, .ignore, or .fdignore file, prefixed with its directory relative to the walk root. Its immutable matcher belongs to that walk; a reload constructs fresh rules.

func Append

func Append(rules []Rule, dir, root string) []Rule

Append adds the rules from dir's .gitignore, .ignore, and .fdignore files, as upstream Pi's addIgnoreRules (core/package-manager.ts) does.

func AppendPatterns

func AppendPatterns(rules []Rule, patterns []string) []Rule

AppendPatterns appends already root-relative ignore patterns without filesystem access. It preserves negation and escaping for environment-backed resource loaders.

Jump to

Keyboard shortcuts

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