From: Zack Cerza Date: Mon, 27 Oct 2025 18:47:49 +0000 (-0700) Subject: shellcheck_job.py: Handle lists of commands X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fheads%2Fshellcheck-lists;p=ceph-build.git shellcheck_job.py: Handle lists of commands Signed-off-by: Zack Cerza --- 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