Skip to content

Commit 0492235

Browse files
viniciusmiguelaescolar
authored andcommitted
scripts: ci: Fix crash when vendor list is malformed
Also introduces friendly error message. Signed-off-by: Vinicius Miguel <[email protected]>
1 parent 894c5c8 commit 0492235

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/ci/check_compliance.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,12 @@ def run(self):
264264
line = line.strip()
265265
if not line or line.startswith("#"):
266266
continue
267-
vendor, _ = line.split("\t", 2)
268-
vendor_prefixes.append(vendor)
267+
try:
268+
vendor, _ = line.split("\t", 2)
269+
vendor_prefixes.append(vendor)
270+
except ValueError:
271+
self.error(f"Invalid line in vendor-prefixes.txt:\"{line}\".")
272+
self.error("Did you forget the tab character?")
269273

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

0 commit comments

Comments
 (0)