Skip to content

Commit 6e2aa07

Browse files
committed
shellcheck_job.py: Handle lists of commands
Signed-off-by: Zack Cerza <zack@cerza.org>
1 parent 6a10989 commit 6e2aa07

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

scripts/shellcheck_job.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ def find(obj: dict, key: str, result=None, path="") -> list[tuple]:
7373
maybe_result = find(v, key, result, subpath)
7474
if maybe_result is not result:
7575
result.append((subpath, maybe_result[-1]))
76+
elif isinstance(v, list):
77+
for index, item in enumerate(v):
78+
if not isinstance(item, dict):
79+
continue
80+
subpath = f"{path}.{index}"
81+
maybe_result = find(item, key, result, subpath)
82+
if maybe_result is not result:
83+
result.append((subpath, maybe_result[-1]))
7684
return result
7785

7886

0 commit comments

Comments
 (0)