MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / get_hash_or_pr_url

Function get_hash_or_pr_url

tools/commitlist.py:507–516  ·  view source on GitHub ↗
(commit: CommitRow)

Source from the content-addressed store, hash-verified

505
506
507def get_hash_or_pr_url(commit: CommitRow) -> str:
508 if not commit.pr_link:
509 return commit.commit_hash
510 matches = re.findall(
511 r'https://github.com/[^/]+/[^/]+/pull/(\d+)',
512 commit.pr_link,
513 )
514 if not matches:
515 return commit.commit_hash
516 return f'[#{matches[0]}]({commit.pr_link})'
517
518
519def markdown_entry_text(commit: CommitRow) -> str:

Callers 2

render_markdownFunction · 0.85
render_category_markdownFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected