MCPcopy Create free account
hub / github.com/apache/tvm / body_with_co_authors

Method body_with_co_authors

ci/scripts/github/github_tvmbot.py:401–422  ·  view source on GitHub ↗

Add 'Co-authored-by' strings to the PR body based on the prior commits in the PR

(self)

Source from the content-addressed store, hash-verified

399 return body.strip()
400
401 def body_with_co_authors(self) -> str:
402 """
403 Add 'Co-authored-by' strings to the PR body based on the prior commits
404 in the PR
405 """
406 body = self.processed_body()
407 author_lines = self.co_authors()
408 logging.info(f"Found co-authors: author_lines={author_lines}")
409 full_author_lines = [f"Co-authored-by: {author_line}" for author_line in author_lines]
410
411 authors_to_add = []
412 for author_line in author_lines:
413 if author_line not in body:
414 authors_to_add.append(f"Co-authored-by: {author_line}")
415
416 if len(authors_to_add) > 0:
417 # If the line isn't already in the PR body (it could have been
418 # added manually), put it in
419 full_author_text = "\n".join(authors_to_add)
420 body = f"{body}\n\n{full_author_text}"
421
422 return body
423
424 def merge(self) -> None:
425 """

Callers 1

mergeMethod · 0.95

Calls 5

processed_bodyMethod · 0.95
co_authorsMethod · 0.95
infoMethod · 0.80
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected