Skip to content

Commit 0446579

Browse files
committed
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 "/Users/carles/src/zephyr/zephyr/../zephyr/scripts/ci/check_compliance.py", line 2053, in main n_fails = _main(args) ^^^^^^^^^^^ File "/Users/carles/src/zephyr/zephyr/../zephyr/scripts/ci/check_compliance.py", line 1988, in _main test.run() File "/Users/carles/src/zephyr/zephyr/../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 <carles.cufi@nordicsemi.no>
1 parent 2f75fcb commit 0446579

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

scripts/ci/check_compliance.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,9 +1456,12 @@ class Identity(ComplianceTest):
14561456

14571457
def run(self):
14581458
for shaidx in get_shas(COMMIT_RANGE):
1459+
commit_info = git('show', '-s', '--format=%an%n%ae%n%b', shaidx).split('\n', 2)
1460+
1461+
if len(commit_info) != 3:
1462+
failures.append(f'{shaidx}: Empty commit message body')
1463+
14591464
auth_name, auth_email, body = git(
1460-
'show', '-s', '--format=%an%n%ae%n%b', shaidx
1461-
).split('\n', 2)
14621465

14631466
match_signoff = re.search(r"signed-off-by:\s(.*)", body,
14641467
re.IGNORECASE)

0 commit comments

Comments
 (0)