MCPcopy Create free account

hub / github.com/denormal/go-gitignore / functions

Functions153 in github.com/denormal/go-gitignore

↓ 26 callersMethodName
NewToken() Name returns a string representation of the Token type.
token.go:30
↓ 19 callersFunctionpos
coincident()
util_test.go:150
↓ 18 callersMethodPosition
Position returns the position in the .gitignore file at which the matching pattern was defined.
match.go:22
↓ 15 callersMethodLocal
match{}
defn_test.go:27
↓ 15 callersMethodMatch
Match returns true if the given path matches the name pattern. If the pattern is meant for directories only, and the path is not a directory, Match wi
pattern.go:18
↓ 13 callersFunctionNewError
err() NewError returns a new Error instance for the given error e and position p.
error.go:21
↓ 11 callersMethodUnderlying
Underlying returns the underlying error, permitting direct comparison against the wrapped error.
error.go:12
↓ 11 callersMethodunread
read() unread returns the given runes to the stream, making them eligible to be read again. The runes are returned in the order given, so the last run
lexer.go:173
↓ 10 callersMethodcreate
repostorytest{}
repository_test.go:24
↓ 10 callersMethodtoken
pattern() token returns a Token instance of the given type_ represented by word runes.
lexer.go:434
↓ 9 callersMethodBase
Base returns the directory containing the .gitignore file.
gitignore.go:19
↓ 9 callersMethodString
String returns a string representation of the matched pattern.
match.go:18
↓ 9 callersFunctiondir
file()
util_test.go:38
↓ 9 callersMethodread
String() private methods read the next rune from the stream. Return an Error if there is a problem reading from the stream. If the end of stream is
lexer.go:145
↓ 8 callersMethodIgnore
Ignore returns true if the match pattern describes files or paths that should be ignored.
match.go:11
↓ 8 callersMethodIsDir
Local()
defn_test.go:37
↓ 8 callersFunctioncoincident
exclude()
util_test.go:143
↓ 7 callersMethodRelative
Relative attempts to match a path relative to the GitIgnore base directory. isdir is used to indicate whether the path represents a file or a director
gitignore.go:39
↓ 7 callersFunctiondirectory
do()
match_test.go:348
↓ 7 callersMethodnext
eol() next returns the next token from the Lexer, or an error if there is a problem reading from the input stream.
parser.go:383
↓ 7 callersFunctionrepository
TestInvalidRepositoryWithCache() helper functions
repository_test.go:303
↓ 7 callersFunctionwithfile
TestNew()
gitignore_test.go:208
↓ 6 callersMethodToken
Name() Token returns the string representation of the Token word.
token.go:35
↓ 6 callersMethoddestroy
create()
repository_test.go:73
↓ 6 callersFunctiondo
TestMatchRelative()
match_test.go:299
↓ 6 callersFunctioninvalid
repository()
repository_test.go:536
↓ 6 callersMethodundo
skip() undo returns the given Token t to the parser input stream to be retrieved again on a subsequent call to next.
parser.go:418
↓ 5 callersMethodInclude
Include returns true if the match pattern describes files or paths that should be included.
match.go:15
↓ 5 callersMethodZero
String() Zero returns true if the Position represents the zero Position
position.go:33
↓ 5 callersFunctionbuffer
pos()
util_test.go:159
↓ 5 callersMethoderr
undo() err returns an Error for the error e, capturing the current parser Position.
parser.go:428
↓ 4 callersMethodAbsolute
Absolute attempts to match an absolute path against this GitIgnore. If the path is not located under the base directory of this GitIgnore, or is not m
gitignore.go:33
↓ 4 callersMethodGet
Get attempts to retrieve an GitIgnore instance associated with the given path. If the path is not known nil is returned.
cache.go:14
↓ 4 callersMethoderrors
err() errors returns the response from the parser error handler to the Error e. If no error handler has been configured for this parser, errors return
parser.go:435
↓ 4 callersFunctionfile
(content string)
util_test.go:15
↓ 4 callersFunctionlexer
TestLexerInvalidCarriageReturn()
lexer_test.go:58
↓ 3 callersMethodParse
Parse returns all well-formed .gitignore Patterns contained within the parser stream. Parsing will terminate at the end of the stream, or if the parse
parser.go:13
↓ 3 callersMethodSet
Set stores the GitIgnore ignore against its path.
cache.go:10
↓ 3 callersFunctionnull
buffer()
util_test.go:164
↓ 3 callersMethodpattern
whitespace() pattern returns all runes representing a file or path pattern, delimited either by unescaped whitespace, a path separator '/' or enf of f
lexer.go:374
↓ 3 callersMethodpeek
unread() peek returns the next rune in the stream without consuming it (i.e. it will be returned by the next call to read or peek). peek will return a
lexer.go:212
↓ 3 callersFunctionrun
invalid()
repository_test.go:712
↓ 3 callersMethodseparator
sequence() separator attempts to retrieve a valid sequence of tokens that may appear after the path separator '/' Token t. An Error is returned if the
parser.go:242
↓ 2 callersMethodMatch
Base() Match attempts to match the path against this GitIgnore, and will return its Match if successful. Match will invoke the GitIgnore error handler
gitignore.go:221
↓ 2 callersFunctionNewPattern
any{} NewPattern returns a Pattern from the ordered slice of Tokens. The tokens are assumed to represent a well-formed .gitignore pattern. A Pattern m
pattern.go:55
↓ 2 callersFunctionNewWithErrors
NewFromFile() NewWithErrors creates a GitIgnore instance from the given file. If errors is given, it will be invoked for every error encountered when
gitignore.go:112
↓ 2 callersMethodNext
Next returns the next Token from the Lexer reader. If an error is encountered, it will be returned as an Error instance, detailing the error and its p
lexer.go:27
↓ 2 callersMethodPosition
Position returns the current position of the parser in the input stream.
parser.go:24
↓ 2 callersMethodPosition
Position returns the position of the error within the .gitignore file (if any)
error.go:8
↓ 2 callersMethodPosition
Next() Position returns the current position of the Lexer.
lexer.go:128
↓ 2 callersMethodString
String returns the string representation of the current position of the Lexer.
lexer.go:34
↓ 2 callersMethodString
Token() String returns a string representation of the Token, encapsulating its position in the input stream, its name (i.e. type), and its runes.
token.go:41
↓ 2 callersMethodString
String returns a string representation of the current position.
position.go:17
↓ 2 callersMethodany
separator() any attempts to retrieve a valid sequence of tokens that may appear after the any '**' Token t. An Error is returned if the sequence if to
parser.go:289
↓ 2 callersMethoderr
token() err returns an Error encapsulating the error e and the current Lexer position.
lexer.go:459
↓ 2 callersFunctionexclude
exclude attempts to return the GitIgnore instance for the $GIT_DIR/info/exclude from the working copy to which path belongs.
exclude.go:10
↓ 2 callersFunctioninvalidparse
parse()
parser_test.go:187
↓ 2 callersMethodmatch
Match() match performs the recursive matching for 'any' patterns. An 'any' token '**' may match any path component, or no path component.
pattern.go:248
↓ 2 callersFunctionparse
TestParserInvalidFalse()
parser_test.go:83
↓ 2 callersMethodpattern
any() pattern attempts to retrieve a valid sequence of tokens that may appear after the path pattern Token t. An Error is returned if the sequence if
parser.go:324
↓ 2 callersMethodsequence
path() sequence attempts to extract a well-formed Token sequence from the Lexer representing a .gitignore Pattern. sequence returns an Error if the re
parser.go:213
↓ 2 callersMethodskip
next() skip reads Tokens from the input until the end of line or end of file is reached. If there is a problem reading tokens, an Error is returned.
parser.go:398
↓ 1 callersMethodAbsolute
Match() Absolute attempts to match an absolute path against this repository. If the path is not located under the base directory of this repository, o
repository.go:197
↓ 1 callersMethodAbsolute
Match() Absolute attempts to match an absolute path against this GitIgnore. If the path is not located under the base directory of this GitIgnore, or
gitignore.go:244
↓ 1 callersMethodIgnore
Ignore returns true if the path is ignored by this GitIgnore. Paths that are not matched by this GitIgnore are not ignored. Internally, Ignore uses Ma
gitignore.go:44
↓ 1 callersMethodInclude
Include returns true if the path is included by this GitIgnore. Paths that are not matched by this GitIgnore are always included. Internally, Include
gitignore.go:49
↓ 1 callersMethodMatch
Match attempts to match the path against this GitIgnore, and will return its Match if successful. Match will invoke the GitIgnore error handler (if de
gitignore.go:28
↓ 1 callersFunctionNew
NewGitIgnore creates a new GitIgnore instance from the patterns listed in t, representing a .gitignore file in the base directory. If errors is given,
gitignore.go:64
↓ 1 callersFunctionNewCache
NewCache returns a Cache instance. This is a thread-safe, in-memory cache for GitIgnore instances.
cache.go:25
↓ 1 callersFunctionNewFromFile
New() NewFromFile creates a GitIgnore instance from the given file. An error will be returned if file cannot be opened or its absolute path determined
gitignore.go:80
↓ 1 callersFunctionNewLexer
NewLexer returns a Lexer instance for the io.Reader r.
lexer.go:38
↓ 1 callersFunctionNewParser
parser{} NewParser returns a new Parser instance for the given stream r. If err is not nil, it will be called for every error encountered during parsi
parser.go:38
↓ 1 callersFunctionNewRepositoryWithCache
NewRepositoryWithErrors() NewRepositoryWithCache returns a GitIgnore instance representing a git repository with a root directory base. As with NewRep
repository.go:99
↓ 1 callersFunctionNewRepositoryWithErrors
NewRepositoryWithFile() NewRepositoryWithErrors returns a GitIgnore instance representing a git repository with a root directory base. As with NewRepo
repository.go:79
↓ 1 callersFunctionNewRepositoryWithFile
NewRepository() NewRepositoryWithFile returns a GitIgnore instance representing a git repository with root directory base. The repository will use fil
repository.go:39
↓ 1 callersFunctionNewToken
NewToken returns a Token instance of the given t, represented by the word runes, at the stream position pos. If the token type is not know, the return
token.go:19
↓ 1 callersFunctionNewWithCache
NewWithErrors() NewWithCache returns a GitIgnore instance (using NewWithErrors) for the given file. If the file has been loaded before, its GitIgnore
gitignore.go:171
↓ 1 callersMethodNext
Next returns the next well-formed .gitignore Pattern from the parser stream. If an error is encountered, and the error handler is either not defined,
parser.go:21
↓ 1 callersMethodNext
Parse() Next returns the next well-formed .gitignore Pattern from the parser stream. If an error is encountered, and the error handler is either not d
parser.go:62
↓ 1 callersMethodPosition
Next() Position returns the current position of the parser in the input stream.
parser.go:125
↓ 1 callersMethodPosition
Position returns the current position of the Lexer.
lexer.go:30
↓ 1 callersMethodRelative
Absolute() Relative attempts to match a path relative to the repository base directory. If the path is not matched by the repository, nil is returned.
repository.go:211
↓ 1 callersMethodRelative
Absolute() Relative attempts to match a path relative to the GitIgnore base directory. isdir is used to indicate whether the path represents a file or
gitignore.go:260
↓ 1 callersMethodany
Match() "any" patterns any returns a Pattern designed to match paths that include at least one any pattern '**', specifying recursive matching.
pattern.go:215
↓ 1 callersMethodbeginning
err() beginning returns true if the Lexer is at the start of a new line.
lexer.go:469
↓ 1 callersMethodbuild
Position() private methods build attempts to build a well-formed .gitignore Pattern starting from the given Token t. An Error will be returned if th
parser.go:145
↓ 1 callersMethodcomment
newline() comment reads all runes until a newline or end of file is reached. An error is returned if an error is encountered reading from the stream.
lexer.go:237
↓ 1 callersMethodcompile
NewPattern() compile generates a specific Pattern (i.e. name, path or any) represented by the list of tokens.
pattern.go:102
↓ 1 callersMethodeol
pattern() eol attempts to consume the next Lexer token to read the end of line or end of file. If a EOL or EOF is not reached , eol will return an err
parser.go:359
↓ 1 callersMethodeol
escape() eol returns all runes from the current position to the end of the line. An error is returned if there is a problem reading from the stream, o
lexer.go:299
↓ 1 callersMethodescape
comment() escape attempts to read an escape sequence (e.g. '\ ') form the input stream. An error will be returned if there is an error reading from th
lexer.go:270
↓ 1 callersMethodname
name patterns - designed to match trailing file/directory names only name returns a Pattern designed to match file or directory names, with no path
pattern.go:145
↓ 1 callersMethodnegation
build() negation attempts to build a well-formed negated .gitignore Pattern starting from the negation Token t. As with build, negation returns an Err
parser.go:161
↓ 1 callersMethodnewline
peek() newline adjusts the positional counters when an end of line is reached
lexer.go:225
↓ 1 callersMethodpath
negation() path attempts to build a well-formed .gitignore Pattern representing a path specification, starting with the Token t. If the sequence of to
parser.go:186
↓ 1 callersMethodpath
Match() path patterns - designed to match complete or partial paths (not just filenames) path returns a Pattern designed to match paths that include
pattern.go:175
↓ 1 callersMethodwhitespace
eol() whitespace returns all whitespace (i.e. ' ' and '\t') runes in a sequence, or an error if there is a problem reading the next runes.
lexer.go:340
MethodBase
NewWithCache() Base returns the directory containing the .gitignore file for this GitIgnore.
gitignore.go:210
FunctionExampleNewFromFile
()
example_test.go:9
FunctionExampleNewRepository
ExampleNewFromFile()
example_test.go:33
next →1–100 of 153, ranked by callers