From 6e2aa07e38e9f802ff4307191ab6203d9e96756b Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Mon, 27 Oct 2025 11:47:49 -0700 Subject: [PATCH] shellcheck_job.py: Handle lists of commands Signed-off-by: Zack Cerza --- scripts/shellcheck_job.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/shellcheck_job.py b/scripts/shellcheck_job.py index 81255567..c7b6433e 100755 --- a/scripts/shellcheck_job.py +++ b/scripts/shellcheck_job.py @@ -73,6 +73,14 @@ def find(obj: dict, key: str, result=None, path="") -> list[tuple]: maybe_result = find(v, key, result, subpath) if maybe_result is not result: result.append((subpath, maybe_result[-1])) + elif isinstance(v, list): + for index, item in enumerate(v): + if not isinstance(item, dict): + continue + subpath = f"{path}.{index}" + maybe_result = find(item, key, result, subpath) + if maybe_result is not result: + result.append((subpath, maybe_result[-1])) return result -- 2.47.3