pyufunc.is_path_ignored#

pyufunc.is_path_ignored(path, patterns, *, root=None)#

Return whether a path matches gitignore-style patterns.

Parameters:
  • path – Path to check.

  • patterns – A pathspec.PathSpec instance or iterable of patterns.

  • root – Optional root used to relativize path before matching.

Note

Example

>>> is_path_ignored("build/out.txt", ["build/"])
True
Returns:

True when the path is ignored.

Return type:

bool