Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLI] Add a subcommand for getting information about a keyboard #8666

Merged
merged 50 commits into from
May 26, 2020

Conversation

skullydazed
Copy link
Member

@skullydazed skullydazed commented Apr 3, 2020

This adds a new command, qmk info, that parses info.json and displays some information about the keyboard. You can specify the keyboard with -kb, by setting user.keyboard, or with the automagic_keyboard functionality.

You can also render the layouts in various ways:

  • -l Show all the layouts with info.json labels
  • -m Show all the layouts with matrix positions
  • -km <keymap> Show the layers for a JSON keymap

Types of Changes

  • Core
  • New feature

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@skullydazed skullydazed added python cli qmk cli command labels Apr 3, 2020
@skullydazed skullydazed requested a review from a team April 3, 2020 21:58
@drashna drashna requested a review from Erovia April 5, 2020 06:23
@skullydazed skullydazed marked this pull request as ready for review April 7, 2020 21:01
@skullydazed
Copy link
Member Author

Showing the command in action

Basic info in text format

Screen Shot 2020-04-07 at 13 11 16

Matrix and Keymap printing

Screen Shot 2020-04-07 at 13 08 29

Layout printing

Screen Shot 2020-04-05 at 15 50 36

Comment on lines +11 to +15
# Supported processor types
ARM_PROCESSORS = 'cortex-m0', 'cortex-m0plus', 'cortex-m3', 'cortex-m4', 'MKL26Z64', 'MK20DX128', 'MK20DX256', 'STM32F042', 'STM32F072', 'STM32F103', 'STM32F303'
AVR_PROCESSORS = 'at90usb1286', 'at90usb646', 'atmega16u2', 'atmega328p', 'atmega32a', 'atmega32u2', 'atmega32u4', None
ALL_PROCESSORS = ARM_PROCESSORS + AVR_PROCESSORS
VUSB_PROCESSORS = 'atmega328p', 'atmega32a'
Copy link
Member

@Erovia Erovia Apr 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note to myself, that this well need to merged somehow with
https://github.com/noroadsleft/qmk_firmware/blob/feature/arm_template/lib/python/qmk/constants.py

@skullydazed
Copy link
Member Author

CI failure is unrelated, same error occurs on master for handwired/onekey/pytest:rgb.

@skullydazed skullydazed requested a review from a team April 19, 2020 19:15
@skullydazed
Copy link
Member Author

This should be ready to go now.

Copy link
Member

@Erovia Erovia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to be thorough, but I'm sure I've missed a few things here and there given the size of this PR.
Overall, very handy feature.

Note: I think this subcommand would benefit from #8817, in order to be able to provide similar output for C keymaps, as it does now for JSON keymaps.

@skullydazed skullydazed requested a review from a team May 17, 2020 19:51
@skullydazed
Copy link
Member Author

All feedback should have been addressed and I've rebased on master.

Copy link
Member

@Erovia Erovia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe these are the last ones.
Fixed the broken list-keymap and some other things.
The checks should be all green with the suggestions.

@Erovia Erovia requested a review from a team May 22, 2020 17:10
zvecr added a commit to zvecr/qmk_firmware that referenced this pull request May 26, 2020
[CLI] Add a subcommand for getting information about a keyboard
@skullydazed skullydazed merged commit 751316c into master May 26, 2020
@skullydazed skullydazed deleted the qmk_info branch May 26, 2020 20:05
@skullydazed skullydazed mentioned this pull request May 26, 2020
5 tasks
nesth pushed a commit to nesth/qmk_firmware that referenced this pull request Jun 11, 2020
* upstream/master: (800 commits)
  Fix crkbd slave matrix print to require debug_matrix (qmk#9217)
  Keyboards/zsa updates (qmk#9214)
  Community layout support for KBDpad Mk.I (qmk#9220)
  Fix projectkb/alice LED indicator (qmk#9226)
  RSTHD keymap for Minidox (qmk#9178)
  Fix running qmk info without any arguments (qmk#9218)
  [Keymap] Update yttyx Planck keymap (qmk#9191)
  Documentation for keymap_extras (qmk#9194)
  Adding TGR Tris/Tris CE Numpad (qmk#9139)
  ISSI driver compile error fix (qmk#9169)
  Fix the path for generated keymaps (qmk#9213)
  Fix compiling json files (qmk#9210)
  [CLI] Add a subcommand for getting information about a keyboard (qmk#8666)
  [Keymap] Contributing Home-Row-Centric-Mousekey  Layout (qmk#9195)
  CLI: fix `json2c` subcommand and add/fix tests (qmk#9206)
  [Keymap] Ported ok60 to via (qmk#9179)
  [Docs] Japanese translation of docs/feature_pointing_device.md (qmk#8993)
  [Keymap] Niu keymap and README update (qmk#9190)
  [Keyboard] Add Key 65 by Fox Lab (qmk#9116)
  [Keymap] update helix/rev2:yshrsmz keymap (qmk#9047)
  ...
turky pushed a commit to turky/qmk_firmware that referenced this pull request Jun 13, 2020
…8666)

You can now use `qmk info` to get information about keyboards and keymaps.

Co-authored-by: Erovia <Erovia@users.noreply.github.com>
jakobaa pushed a commit to jakobaa/qmk_firmware that referenced this pull request Jul 7, 2020
…8666)

You can now use `qmk info` to get information about keyboards and keymaps.

Co-authored-by: Erovia <Erovia@users.noreply.github.com>
drashna pushed a commit to zsa/qmk_firmware that referenced this pull request Aug 9, 2020
…8666)

You can now use `qmk info` to get information about keyboards and keymaps.

Co-authored-by: Erovia <Erovia@users.noreply.github.com>
sjmacneil pushed a commit to sjmacneil/qmk_firmware that referenced this pull request Feb 19, 2021
…8666)

You can now use `qmk info` to get information about keyboards and keymaps.

Co-authored-by: Erovia <Erovia@users.noreply.github.com>
BorisTestov pushed a commit to BorisTestov/qmk_firmware that referenced this pull request May 23, 2024
…8666)

You can now use `qmk info` to get information about keyboards and keymaps.

Co-authored-by: Erovia <Erovia@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli qmk cli command python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants