Skip to content

Commit

Permalink
qmk find: Fix failure with multiple filters (#22497)
Browse files Browse the repository at this point in the history
When multiple `-f FILTER` options were specified, `qmk find` did not
return anything at all instead of printing the list of entries that
matched all of the specified filters.

The problem was that the statement in `_filter_keymap_targets()` that
filled `targets` had a wrong indent and therefore was executed for every
filter instead of only once after applying all filters, and
`valid_keymaps` was actually an iterator and therefore could be used
only once.  Moving the statement outside of the loop fixes the problem.
  • Loading branch information
sigprof authored Nov 18, 2023
1 parent bf3a88a commit 62cca5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/python/qmk/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def f(e):
cli.log.warning(f'Unrecognized filter expression: {filter_expr}')
continue

targets = [KeyboardKeymapBuildTarget(keyboard=e[0], keymap=e[1], json=e[2]) for e in valid_keymaps]
targets = [KeyboardKeymapBuildTarget(keyboard=e[0], keymap=e[1], json=e[2]) for e in valid_keymaps]

return targets

Expand Down

0 comments on commit 62cca5c

Please sign in to comment.