roboto.paths
Module Contents
DOTFILE_PATTERN
Git wildmatch pattern for a path with any component that starts with a dot, e.g. .env or .cache/run.bag. Triggers never run on these files, and file listings leave them out.
excludespec_from_patterns()
Transform a list of Git wildmatch patterns into a pathspec.PathSpec.
Parameters
exclude_patterns Optional[collections.Return type
is_dotfile_path()
Whether path matches DOTFILE_PATTERN.
Parameters
path strReturn type
join_within()
Return directory / relative_path, refusing a path that resolves outside directory.
A file’s stored path comes from the server and is not trusted to stay inside the directory it is written to.
Parameters
directory pathlib.relative_path strRaises
relative_path is absolute or climbs out of directory.
Return type
path_matches()
Does the given path match the given include pattern(s) and not match the given exclude pattern(s)?
Parameters
path strinclude_patterns Optional[collections.exclude_patterns Optional[collections.Return type
path_matches_specs()
path_matches() for patterns already compiled with pathspec_from_patterns(), for callers that match many paths against the same patterns.
Parameters
path strinclude_spec Optional[pathspec.exclude_spec Optional[pathspec.Return type
path_to_pattern()
Transform a literal path into a Git wildmatch pattern that matches that literal path.
Parameters
path strReturn type
pathspec_from_patterns()
Transform a list of Git wildmatch patterns into a pathspec.PathSpec.
Parameters
patterns collections.Return type
pattern_to_like_value()
Parameters
pattern strReturn type
patterns_to_condition_group()
Transform a list of Git wildmatch patterns into a ConditionGroup.
patterns must be non-empty. An empty iterable yields a zero-condition group, which ConditionGroup rejects with a ValueError; callers treat an empty pattern list as no filter and skip this call rather than passing it through.
Parameters
patterns collections.path_field_name strcomparator roboto.operator roboto.Return type