Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: uxlfoundation/oneDNN
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 938cf81df280b8ca3516fc2db547a96812c97299
Choose a base ref
...
head repository: uxlfoundation/oneDNN
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fe519cae4ae4e9490444da69fe72266ef7ba9338
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Dec 19, 2024

  1. workflows: automation: removed redundant code and improved formatting

    vpirogov committed Dec 19, 2024
    Copy the full SHA
    fe519ca View commit details
Showing with 10 additions and 8 deletions.
  1. +10 −8 .github/automation/commit-msg-check.py
18 changes: 10 additions & 8 deletions .github/automation/commit-msg-check.py
Original file line number Diff line number Diff line change
@@ -31,22 +31,22 @@ def __scopeCheck(msg: str):
status = "Message scope: "

if not re.match('^[a-z0-9]+(, [a-z0-9]+)*: ', msg):
print(f"{status} FAILED: Commit message must follow the format <scope>:[ <scope>:] <short description>")
print(f"{status} FAILED: Commit message must follow the format "
"<scope>:[ <scope>:] <short description>")
return False

print(f"{status} OK")
return True

# Ensuring a character limit for the first line.
# Ensure a character limit for the first line.
def __numCharacterCheck(msg: str):
status = "Message length:"
summary = msg.partition("\n")[0]
msgSummaryLen = len(summary)
if msgSummaryLen <= 72:
if len(msg) <= 72:
print(f"{status} OK")
return True
else:
print(f"{status} FAILED: Commit message summary must not exceed 72 characters.")
print(f"{status} FAILED: Commit message summary must not "
"exceed 72 characters.")
return False

def main():
@@ -58,7 +58,8 @@ def main():
head: str = args.head

commit_range = base + ".." + head
messages = subprocess.run(["git", "rev-list", "--format=oneline", commit_range], capture_output=True, text=True).stdout
messages = subprocess.run(["git", "rev-list", "--format=oneline",
commit_range], capture_output=True, text=True).stdout

is_ok = True
for i in messages.splitlines():
@@ -72,7 +73,8 @@ def main():
if is_ok:
print("All commmit messages are formatted correctly. ")
else:
print("Some commit message checks failed. Please align commit messages with Contributing Guidelines and update the PR.")
print("Some commit message checks failed. Please align commit messages "
"with Contributing Guidelines and update the PR.")
exit(1)