class documentation
class IgnoreFilter:
Constructors: IgnoreFilter.from_path(path, ignorecase), IgnoreFilter(patterns, ignorecase, path)
Filter to apply gitignore patterns.
Important: When checking if directories are ignored, include a trailing slash. For example, use is_ignored("dir/") instead of is_ignored("dir").
| Class Method | from |
Create an IgnoreFilter from a file path. |
| Method | __init__ |
Initialize an IgnoreFilter with a set of patterns. |
| Method | __repr__ |
Return string representation of IgnoreFilter. |
| Method | append |
Add a pattern to the set. |
| Method | find |
Yield all matching patterns for path. |
| Method | is |
Check whether a path is ignored using Git-compliant logic. |
| Method | _apply |
Apply Git's parent directory exclusion rule. |
| Instance Variable | _ignorecase |
Undocumented |
| Instance Variable | _path |
Undocumented |
| Instance Variable | _patterns |
Undocumented |
Create an IgnoreFilter from a file path.
| Parameters | |
path:str | os.PathLike[ | Path to the ignore file. |
ignorecase:bool | Whether to perform case-insensitive matching. |
| Returns | |
IgnoreFilter | An IgnoreFilter instance with patterns loaded from the file. |
Check whether a path is ignored using Git-compliant logic.
For directories, include a trailing slash.
- Returns: status is None if file is not mentioned, True if it is
- included, False if it is explicitly excluded.