Skip to content

refactor(generator): layout detection rely on qmk info#14

Merged
severindupouy merged 6 commits into
mainfrom
refactor/layout-detection
May 23, 2026
Merged

refactor(generator): layout detection rely on qmk info#14
severindupouy merged 6 commits into
mainfrom
refactor/layout-detection

Conversation

@severindupouy

@severindupouy severindupouy commented May 23, 2026

Copy link
Copy Markdown
Collaborator

Previously layout detection inspected QMK_HOME subfolders with a regex over keyboard sources — fragile and forcing QMK_HOME to be populated even for generate-only runs. qmk info is QMK's own declaration of which layouts a board exposes; intersecting it with shared/layouts.h gives an authoritative match and lets the generator work without a populated QMK_HOME (until --copy is used).

BREAKING CHANGE:

  • Layout detection now relies on qmk info instead of inspecting QMK_HOME subfolders.
  • jq is required.

The variable named the project root, but sat alongside QMK_HOME (the
actual QMK firmware repo) — both prefixed with "QMK", with different
meanings. REPO_DIR is unambiguous and removes the collision.
@severindupouy severindupouy changed the title refactor(generator: layout detection rely on qmk cli refactor(generator): layout detection rely on qmk cli May 23, 2026
@severindupouy severindupouy changed the title refactor(generator): layout detection rely on qmk cli refactor(generator): layout detection rely on qmk info May 23, 2026
Previously layout detection inspected QMK_HOME subfolders with a
regex over keyboard sources — fragile and forcing QMK_HOME to be
populated even for generate-only runs. `qmk info` is QMK's own
declaration of which layouts a board exposes; intersecting it with
shared/layouts.h gives an authoritative match and lets the generator
work without a populated QMK_HOME (until `--copy` is used).

BREAKING CHANGE:
- Layout detection now relies on `qmk info` instead of inspecting
  QMK_HOME subfolders.
- `jq` is required.
Trims install instructions in favor of pointing at QMK's own
getting-started guide, adds `jq` as a prerequisite, drops dead
`user.keymap` config, and aligns the compile/flash example with the
generator's post-copy hint (explicit `-kb -km`). Generator options
table now mirrors `usage()` placeholder names.
README now lists boards by shape and name (Ctrl+F-friendly); per-board
override macros and caveats live in docs/supported_keyboards.md.
New docs/keebart_keyboards.md covers the Keebart fork setup: Corne
Choc Pro (tested) and Corne MX Pro (untested). README gains a "Boards
not in mainline QMK" subsection pointing at the worked example and
listing vial-qmk as another fork worth checking.
@doc75

doc75 commented May 23, 2026

Copy link
Copy Markdown
Contributor

I tested this branch for the Atreus and it works like charm.
No need to specify the layout (values taken from qmk are OK), it also support the fact that I declared selenium as my keymap in qmk 👍
The tests are passing without any issue.

I have gone through the modified files, but some parts are above my expertise level to challenge them.

@severindupouy

Copy link
Copy Markdown
Collaborator Author

I tested this branch for the Atreus and it works like charm. No need to specify the layout (values taken from qmk are OK), it also support the fact that I declared selenium as my keymap in qmk 👍 The tests are passing without any issue.

I have gone through the modified files, but some parts are above my expertise level to challenge them.

Great, thank for testing!

@severindupouy severindupouy merged commit bf3b71a into main May 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants