From 2f75fcba47e1d8e856d8f74b6779c1b5cb91f77e Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Tue, 13 May 2025 13:25:56 +0200 Subject: [PATCH 1/2] cmake: change --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce8e677d7eb..b471f65473b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 + # *DOCUMENTATION* # # Note that this is *NOT* the top-level CMakeLists.txt. That's in the From bc8d6c3a8c39e892d4066ebe64b53f2bb6b4953c Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Tue, 13 May 2025 13:39:30 +0200 Subject: [PATCH 2/2] scripts: compliance: Avoid exception when commit message body is empty Avoid the following exception in the Identity test when the commit body is empty: Traceback (most recent call last): File "zephyr/scripts/ci/check_compliance.py", line 2053, in main n_fails = _main(args) ^^^^^^^^^^^ File "zephyr/scripts/ci/check_compliance.py", line 1988, in _main test.run() File "zephyr/scripts/ci/check_compliance.py", line 1459, in run auth_name, auth_email, body = git( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: not enough values to unpack (expected 3, got 2) Signed-off-by: Carles Cufi --- scripts/ci/check_compliance.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 0b82bcce456..e22ec86bd33 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1456,17 +1456,24 @@ class Identity(ComplianceTest): def run(self): for shaidx in get_shas(COMMIT_RANGE): - auth_name, auth_email, body = git( - 'show', '-s', '--format=%an%n%ae%n%b', shaidx - ).split('\n', 2) + commit_info = git('show', '-s', '--format=%an%n%ae%n%b', shaidx).split('\n', 2) + + failures = [] + + if len(commit_info) == 2: + failures.append(f'{shaidx}: Empty commit message body') + auth_name, auth_email = commit_info + body = '' + elif len(commit_info) == 3: + auth_name, auth_email, body = commit_info + else: + self.failure(f'Unable to parse commit message for {shaidx}') match_signoff = re.search(r"signed-off-by:\s(.*)", body, re.IGNORECASE) detailed_match = re.search(r"signed-off-by:\s(.*) <(.*)>", body, re.IGNORECASE) - failures = [] - if auth_email.endswith("@users.noreply.github.com"): failures.append(f"{shaidx}: author email ({auth_email}) must " "be a real email and cannot end in "