Skip to content

Commit

Permalink
scripts: ci: Fix crash when vendor list is malformed
Browse files Browse the repository at this point in the history
Also introduces friendly error message.

Signed-off-by: Vinicius Miguel <[email protected]>
  • Loading branch information
viniciusmiguel authored and aescolar committed Sep 2, 2024
1 parent 894c5c8 commit 0492235
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/ci/check_compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,12 @@ def run(self):
line = line.strip()
if not line or line.startswith("#"):
continue
vendor, _ = line.split("\t", 2)
vendor_prefixes.append(vendor)
try:
vendor, _ = line.split("\t", 2)
vendor_prefixes.append(vendor)
except ValueError:
self.error(f"Invalid line in vendor-prefixes.txt:\"{line}\".")
self.error("Did you forget the tab character?")

path = Path(ZEPHYR_BASE)
for file in path.glob("**/board.yml"):
Expand Down

0 comments on commit 0492235

Please sign in to comment.