Module util

Module util 

Source
Expand description

Utility functions for parsing and working with GitHub CLI output and other utility functions.

Functions§

canonicalize_repo_url
Canonicalize a repository URL to the form https://{host}/{repo}
ensure_https_prefix
Add https:// to a URL if it is not already present
first_abs_path_from_str
Parse an absolute path from a string. This assumes that the the first ‘/’ found in the string is the start of the path.
first_path_from_str
Parse a path from a string
id_from_job_lines
Extract the job IDs from the lines with job information
issue_text_similarity
Calculate the smallest levenshtein distance between an issue body and other issue bodies
remove_ansi_codes
Remove ANSI codes from a string
remove_non_ascii
Remove non-ASCII characters from a string
remove_timestamp_prefixes
Parse a log and remove line-prefixed timestamps in the format YYYY-MM-DDTHH:MM:SS.0000000Z (ISO 8601).
remove_timestamps_and_ids
Parse text for timestamps and IDs and remove them, returning the modified text without making a copy.
repo_to_owner_repo_fragments
Parse a repository URL/identifier to owner and repo fragments
take_lines_with_failed_jobs
Take the lines with failed jobs from the output of gh run view