modal.FilePatternMatcher
Allows matching file Path objects against a list of patterns.
Usage:
Initialize a new FilePatternMatcher instance.
Args: pattern (str): One or more pattern strings.
Raises: ValueError: If an illegal exclusion pattern is provided.
can_prune_directories
Returns True if this pattern matcher allows safe early directory pruning.
Directory pruning is safe when matching directories can be skipped entirely without missing any files that should be included. This is for example not safe when we have inverted/negated ignore patterns (e.g. ”!*/.py”).
from_file
Initialize a new FilePatternMatcher instance from a file.
The patterns in the file will be read lazily when the matcher is first used.
Args: file_path (Path): The path to the file containing patterns.
Usage: