Skip to content

Commit 82fd615

Browse files
mathieuchopstmcfriedt
authored andcommitted
scripts: ci: check_compliance: fix potential unbound variable access
When checking for emails/sign-off, if parsing of the commit information using 'git show' fails, the 'auth_name', 'auth_email' and 'body' variables are unbound but accessed right afterwards, which would cause an error. Skip straight to next iteration of the loop when such an error occurs to ensure access to the unbound variables is never performed. This error was reported by the VS Code Pylance analyzer. Signed-off-by: Mathieu Choplain <[email protected]>
1 parent 5454543 commit 82fd615

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

scripts/ci/check_compliance.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,6 +1744,7 @@ def run(self):
17441744
auth_name, auth_email, body = commit_info
17451745
else:
17461746
self.failure(f'Unable to parse commit message for {shaidx}')
1747+
continue
17471748

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

0 commit comments

Comments
 (0)