Skip to content

IgnoreFilter class

Parameters

NameTypeDefaultDescription
pathstros.getcwd()The directory to look for ignore files
ignore_filestr.gitignoreThe ignore filename

Methods

match

Test whether FILENAME matches pattern

Parameters

NameTypeDescription
namestrFilename to match.

match_case

Test whether FILENAME matches pattern, including case.

Parameters

NameTypeDescription
namestrFilename to match.

filter

Construct a list from those elements of the iterable NAMES that match pattern.

Parameters

NameTypeDescription
namesIterable[str]A list of path names.

Example

Load .dockerignore

py
import gitfiles
filter = gitfiles.IgnoreFilter(ignore_file='.dockerignore')

filter.match('file.so')

Not associated with or approved by Mojang Studios or Microsoft