FilePatternMatcher

class

gworker_client.filematch.FilePatternMatcher

Holds a list of glob patterns and tests file paths against them. Used internally by the CLI to apply .gworkerignore exclusions during tarball creation.

Class

python
1class FilePatternMatcher

Methods

from_file

python
1from_file(path: str | Path) -> FilePatternMatcher

Read glob patterns from a file (one per line, # comments supported). Intended for .gworkerignore files.

matches

python
1matches(relpath: str) -> bool

Return True if relpath matches any pattern. Paths are forward-slash normalised before matching.

filter

python
1filter(paths: Iterable[str]) -> list[str]

Return only the paths that should be kept (i.e. those that do NOT match any ignore pattern).

← Back to docs