ignore

package
v0.0.0-...-9a66a57 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

package ignore provides helpers to support ignore-files similar to .gitignore

Index

Constants

This section is empty.

Variables

View Source
var (
	IgnoreFile = ".sourcegraph/ignore"
)

Functions

This section is empty.

Types

type Matcher

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

func ParseIgnoreFile

func ParseIgnoreFile(r io.Reader) (matcher *Matcher, error error)

ParseIgnoreFile parses an ignore-file according to the following rules

- each line represents a glob-pattern relative to the root of the repository - for patterns without any glob-characters, a trailing ** is implicit - lines starting with # are ignored - empty lines are ignored

func (*Matcher) Match

func (m *Matcher) Match(path string) bool

Match returns true if path has a prefix in common with any item in m.ignoreList

Jump to

Keyboard shortcuts

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