Skip to content

Commit f3caf3c

Browse files
committed
scripts: sort boards alphabetically
Sort the output alphabetically when executing 'west boards'. Doing so makes it simpler to locate boards while scrolling through the list of all accessible boards. This method is compatible with the '-n' argument too, which also will result in a filtered and sorted list. Signed-off-by: Joakim Bech <joakim.bech@gmail.com>
1 parent 76e1fc7 commit f3caf3c

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

doc/_extensions/zephyr/kconfig/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, dict[str, str]]:
118118
root_args = argparse.Namespace(**{'board_roots': [Path(ZEPHYR_BASE)],
119119
'soc_roots': [Path(ZEPHYR_BASE)], 'board': None,
120120
'board_dir': []})
121-
v2_boards = list_boards.find_v2_boards(root_args).values()
121+
v2_boards = list_boards.find_v2_boards(root_args)
122122

123123
with open(Path(td) / "boards" / "Kconfig.boards", "w") as f:
124124
for board in v2_boards:

scripts/ci/check_compliance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ def get_v2_model(self, kconfig_dir, settings_file):
522522
root_args = argparse.Namespace(**{'board_roots': board_roots,
523523
'soc_roots': soc_roots, 'board': None,
524524
'board_dir': []})
525-
v2_boards = list_boards.find_v2_boards(root_args).values()
525+
v2_boards = list_boards.find_v2_boards(root_args)
526526

527527
with open(kconfig_defconfig_file, 'w') as fp:
528528
for board in v2_boards:

scripts/ci/test_plan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def find_boards(self):
248248
# Look for boards in monitored repositories
249249
lb_args = argparse.Namespace(**{'arch_roots': roots, 'board_roots': roots, 'board': None, 'soc_roots':roots,
250250
'board_dir': None})
251-
known_boards = list_boards.find_v2_boards(lb_args).values()
251+
known_boards = list_boards.find_v2_boards(lb_args)
252252

253253
for changed in changed_boards:
254254
for board in known_boards:

scripts/list_boards.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def find_v2_boards(args):
347347
board_extensions.extend(e)
348348

349349
extend_v2_boards(boards, board_extensions)
350-
return boards
350+
return sorted(boards.values(), key=lambda board: board.name)
351351

352352

353353
def parse_args():
@@ -415,7 +415,7 @@ def board_v2_qualifiers_csv(board):
415415
def dump_v2_boards(args):
416416
boards = find_v2_boards(args)
417417

418-
for b in boards.values():
418+
for b in boards:
419419
qualifiers_list = board_v2_qualifiers(b)
420420
if args.cmakeformat is not None:
421421
notfound = lambda x: x or 'NOTFOUND'

scripts/pylib/twister/twisterlib/platform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def generate_platforms(board_roots, soc_roots, arch_roots):
209209
lb_args = Namespace(board_roots=board_roots, soc_roots=soc_roots, arch_roots=arch_roots,
210210
board=None, board_dir=None)
211211

212-
for board in list_boards.find_v2_boards(lb_args).values():
212+
for board in list_boards.find_v2_boards(lb_args):
213213
for board_dir in board.directories:
214214
if board_dir in dir2data:
215215
# don't load the same board data twice

scripts/west_commands/boards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def do_run(self, args, _):
106106
revisions=revisions_list,
107107
dir=board.dir, hwm=board.hwm, qualifiers=''))
108108

109-
for board in list_boards.find_v2_boards(args).values():
109+
for board in list_boards.find_v2_boards(args):
110110
if name_re is not None and not name_re.search(board.name):
111111
continue
112112

0 commit comments

Comments
 (0)