Skip to content

Commit

Permalink
doc: extensions: table_from_rows: handle extra_args as list
Browse files Browse the repository at this point in the history
Twister files support giving extra_args as string or list. Until now,
lists haven't been used, but when used they'll cause the extension to
crash producing cryptic Sphinx errors.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
  • Loading branch information
gmarull authored and carlescufi committed May 16, 2024
1 parent 528f837 commit 02cd095
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions doc/_extensions/table_from_rows.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,16 @@ def _find_shields(shields: Dict[str, Set[str]], sample_data: dict):
"""Associate all integration platforms for a sample with any shield used.
"""

if 'extra_args' not in sample_data:
extra_args_raw = sample_data.get('extra_args')
if not extra_args_raw:
return

shield_args = re.findall(r'SHIELD=(\S*)', sample_data['extra_args'])
if isinstance(extra_args_raw, list):
extra_args = " ".join(extra_args_raw)
else:
extra_args = extra_args_raw

shield_args = re.findall(r'SHIELD=(\S*)', extra_args)
if not shield_args:
return

Expand Down

0 comments on commit 02cd095

Please sign in to comment.