MCPcopy Index your code
hub / github.com/huggingface/diffusers / parse_commit_message

Function parse_commit_message

utils/tests_fetcher.py:1026–1049  ·  view source on GitHub ↗

Parses the commit message to detect if a command is there to skip, force all or part of the CI. Args: commit_message (`str`): The commit message of the current commit. Returns: `Dict[str, bool]`: A dictionary of strings to bools with keys the following keys: `"skip"`,

(commit_message: str)

Source from the content-addressed store, hash-verified

1024
1025
1026def parse_commit_message(commit_message: str) -> dict[str, bool]:
1027 """
1028 Parses the commit message to detect if a command is there to skip, force all or part of the CI.
1029
1030 Args:
1031 commit_message (`str`): The commit message of the current commit.
1032
1033 Returns:
1034 `Dict[str, bool]`: A dictionary of strings to bools with keys the following keys: `"skip"`,
1035 `"test_all_models"` and `"test_all"`.
1036 """
1037 if commit_message is None:
1038 return {"skip": False, "no_filter": False, "test_all": False}
1039
1040 command_search = re.search(r"\[([^\]]*)\]", commit_message)
1041 if command_search is not None:
1042 command = command_search.groups()[0]
1043 command = command.lower().replace("-", " ").replace("_", " ")
1044 skip = command in ["ci skip", "skip ci", "circleci skip", "skip circleci"]
1045 no_filter = set(command.split(" ")) == {"no", "filter"}
1046 test_all = set(command.split(" ")) == {"test", "all"}
1047 return {"skip": skip, "no_filter": no_filter, "test_all": test_all}
1048 else:
1049 return {"skip": False, "no_filter": False, "test_all": False}
1050
1051
1052if __name__ == "__main__":

Callers 1

tests_fetcher.pyFile · 0.85

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…