From 2147e4e534b5a8cbcaa59155e416feefe687a07f Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 9 Mar 2026 14:07:04 +1100 Subject: [PATCH] Tools: check_branch_conventions.py: sanity check author emails on commits --- Tools/scripts/check_branch_conventions.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Tools/scripts/check_branch_conventions.py b/Tools/scripts/check_branch_conventions.py index 11c9d17a19f..766f6da650f 100755 --- a/Tools/scripts/check_branch_conventions.py +++ b/Tools/scripts/check_branch_conventions.py @@ -129,6 +129,23 @@ class CheckBranchConventions(build_script_base.BuildScriptBase): print(f"{PASS} All commit subject lines within {MAX_SUBJECT_LEN} characters.") return ok + def check_author_emails(self) -> bool: + emails = self.run_git( + ["log", f"{self.base_branch}..HEAD", "--format=%ae"], + show_output=False, + ).strip() + bad = [] + for email in emails.splitlines(): + if "example.com" in email: + bad.append(email) + if bad: + print(f"{FAIL} Author email(s) with example.com are not allowed:") + for email in bad: + print(f" {email}") + return False + print(f"{PASS} No unacceptable author emails.") + return True + def check_markdown(self) -> bool: changed_md = self.run_git( ["diff", "--name-only", "--diff-filter=AM", @@ -170,6 +187,7 @@ class CheckBranchConventions(build_script_base.BuildScriptBase): self.check_fixup_commits(commits), self.check_commit_messages(commits), self.check_commit_lengths(commits), + self.check_author_emails(), self.check_markdown(), ]