class documentation

Ignore file manager with Git-compliant behavior.

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_repo Create a IgnoreFilterManager from a repository.
Method __init__ Initialize an IgnoreFilterManager.
Method __repr__ Return string representation of IgnoreFilterManager.
Method find_matching Find matching patterns for path.
Method is_ignored Check whether a path is explicitly included or excluded in ignores.
Method _apply_directory_traversal_rule Apply directory traversal rule for issue #1203.
Method _load_path Undocumented
Instance Variable _global_filters Undocumented
Instance Variable _ignorecase Undocumented
Instance Variable _path_filters Undocumented
Instance Variable _top_path Undocumented
def from_repo(cls, repo: Repo) -> IgnoreFilterManager:

Create a IgnoreFilterManager from a repository.

Parameters
repo:RepoRepository object
Returns
IgnoreFilterManagerA IgnoreFilterManager object
def __init__(self, top_path: str, global_filters: list[IgnoreFilter], ignorecase: bool):

Initialize an IgnoreFilterManager.

Parameters
top_path:strThe top-level directory path to manage ignores for.
global_filters:list[IgnoreFilter]List of global ignore filters to apply.
ignorecase:boolWhether to perform case-insensitive matching.
def __repr__(self) -> str:

Return string representation of IgnoreFilterManager.

def find_matching(self, path: str) -> Iterable[Pattern]:

Find matching patterns for path.

Parameters
path:strPath to check
Returns
Iterable[Pattern]Iterator over Pattern instances
def is_ignored(self, path: str) -> bool | None:

Check whether a path is explicitly included or excluded in ignores.

Parameters
path:strPath to check. For directories, the path should end with '/'.
Returns
bool | NoneNone if the file is not mentioned, True if it is included, False if it is explicitly excluded.
def _apply_directory_traversal_rule(self, path: str, matches: list[Pattern]) -> bool:

Apply directory traversal rule for issue #1203.

If a directory would be ignored by a ** pattern, but there are negation patterns for its subdirectories, then the directory itself should not be ignored (to allow traversal).

def _load_path(self, path: str) -> IgnoreFilter | None:

Undocumented

_global_filters =

Undocumented

_ignorecase =

Undocumented

_path_filters: dict[str, IgnoreFilter | None] =

Undocumented

_top_path =

Undocumented