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

Add a lot more data to info.json #13366

Merged
merged 37 commits into from
Aug 16, 2021
Merged

Add a lot more data to info.json #13366

merged 37 commits into from
Aug 16, 2021

Conversation

skullydazed
Copy link
Member

@skullydazed skullydazed commented Jun 28, 2021

Description

This adds a lot of new information to info.json. Besides adding more keyboard metadata we have also added tags! Just add a new top-level key to info.json containing a list of your tags. Example:

{
    "tags": ["tkl", "split"]
}

This also changes the output of qmk info -f text to use dot-notation. This will be handy in the future as we add the ability to query based on JSON information.

Example qmk info -f text output
  skully@zayante:~/qmk_firmware:0$ qmk info -kb clueboard/card -f text
  bootloader: atmel-dfu
  debounce: 20
  diode_direction: ROW2COL
  features.audio: True
  features.backlight: True
  features.bluetooth: False
  features.bootmagic: False
  features.command: True
  features.console: True
  features.extrakey: True
  features.lto: True
  features.midi: False
  features.mousekey: True
  features.nkro: False
  features.rgblight: True
  features.unicode: False
  height: 8
  keyboard_folder: clueboard/card
  keyboard_name: Cluecard
  layout_aliases.LAYOUT: LAYOUT_all
  layouts: LAYOUT_all
  maintainer: skullydazed
  manufacturer: Clueboard
  matrix_pins.cols: F1, F6, F7
  matrix_pins.rows: B4, F0, F4, F5
  platform: unknown
  processor: atmega32u4
  processor_type: avr
  protocol: LUFA
  rgblight.brightness_steps: 17
  rgblight.hue_steps: 10
  rgblight.led_count: 4
  rgblight.pin: E6
  rgblight.saturation_steps: 17
  split.transport.protocol: serial
  usb.device_ver: 0x0001
  usb.pid: 0x2330
  usb.vid: 0xC1ED
  width: 10

Types of Changes

  • Core
  • Enhancement/optimization

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • I have read the CONTRIBUTING document.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@skullydazed skullydazed requested a review from a team June 28, 2021 04:57
@github-actions github-actions bot added cli qmk cli command keyboard python labels Jun 28, 2021
Copy link
Member

@noroadsleft noroadsleft left a comment

Choose a reason for hiding this comment

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

qmk info -h seems to imply qmk info -f defaults to friendly, but this doesn't work in practice:

 noroadsleft  ~/qmk_firmware/keyboards/clueboard/66/rev4  (pr/13366)
$ qmk info -f
usage: qmk.exe info [-h] [-r] [--ascii] [-f FORMAT] [-m] [-l] [-km KEYMAP] [-kb KEYBOARD]
qmk.exe info: error: argument -f/--format: expected one argument

 noroadsleft  ~/qmk_firmware/keyboards/clueboard/66/rev4  (pr/13366)
$ qmk info -h
usage: qmk.exe info [-h] [-r] [--ascii] [-f FORMAT] [-m] [-l] [-km KEYMAP] [-kb KEYBOARD]

optional arguments:
  -h, --help            show this help message and exit
  -r, --rules-mk        Render the parsed values of the keyboard's rules.mk file.
  --ascii               Render layout box drawings in ASCII only.
  -f FORMAT, --format FORMAT
                        Format to display the data in (friendly, text, json) (Default: friendly).
  -m, --matrix          Render the layouts with matrix information.
  -l, --layouts         Render the layouts.
  -km KEYMAP, --keymap KEYMAP
                        Show the layers for a JSON keymap too.
  -kb KEYBOARD, --keyboard KEYBOARD
                        Keyboard to show info for.

Specifying friendly also doesn't seem to do anything:

 noroadsleft  ~/qmk_firmware/keyboards/clueboard/66/rev4  (pr/13366)
$ qmk info -f friendly
Keyboard Name: Clueboard 66% rev4
Manufacturer: Clueboard
Maintainer: skullydazed
Keyboard Folder: clueboard/66/rev4
Layouts: LAYOUT_66_ansi, LAYOUT_66_iso, LAYOUT_all
Size: 16.5 x 5
Processor: STM32F303
Bootloader: stm32-dfu
Layout aliases: KEYMAP=LAYOUT_all, LAYOUT=LAYOUT_all

@skullydazed
Copy link
Member Author

Apologies for missing this last week.

qmk info -h seems to imply qmk info -f defaults to friendly, but this doesn't work in practice:

You have to supply an argument to -f. If you don't supply -f at all it defaults to the friendly output.

Specifying friendly also doesn't seem to do anything:

That's working as designed. If you were to override the default output, EG qmk config info.format=text, then using qmk info -f friendly would look different.

@skullydazed
Copy link
Member Author

Tests are passing now and it can merge clean.

data/schemas/keyboard.jsonschema Outdated Show resolved Hide resolved
data/mappings/info_config.json Outdated Show resolved Hide resolved
@skullydazed
Copy link
Member Author

I've rebased against develop and fixed a couple new errors that cropped up.

@zvecr zvecr merged commit 8d9bfdc into develop Aug 16, 2021
@drashna drashna deleted the schema_improvements branch November 23, 2021 15:41
nhongooi pushed a commit to nhongooi/qmk_firmware that referenced this pull request Dec 5, 2021
* add some split data to info.json

* add tags

* add half of config_options.md to info.json

* add support for designating master split

* sort out split transport and primary

* fix bad data in UNUSED_PINS

* fixup custom transport

* wip

* allow for setting split right half keyboard matrix

* add SPLIT_USB_DETECT

* minor cleanup

* fix an erroneous message

* rework split.usb_detect

* adding missing rgblight vars to info.json

* add mouse_key to info.json

* add all remaining options from docs/config_options.md

* fix audio voices

* qmk info: Change text output to use dotted notation

* tweak layout output

* resolve alias names

* break out some functions to make flake8 happy

* add a field for bootloader instructions

* qmk generate-info-json: add a write-to-file argument

Adds an argument that instructs qmk generate-info-json to write the output to a file instead of just to the terminal.

* -arg_only, +action

Because it was never my intention that one would have to specify a value for the argument that enables writing the file.

* Bring qmk generate-info-json inline with other generate commands

* pytest fixup

* fix esca/getawayvan

* fix data driven errors for bpiphany converters

* features.force_nkro -> usb.force_nkro

* split.primary->split.main

* fix esca/getawayvan_f042

* fix the bpiphany converters for real

* fix bpiphany/tiger_lily

* Apply suggestions from code review

Co-authored-by: Nick Brassel <[email protected]>

* fix generate-api errors

* fix matrix pin extraction for split boards

* fix ploopyco/trackball_nano/rev1_001

Co-authored-by: James Young <[email protected]>
Co-authored-by: Nick Brassel <[email protected]>
BorisTestov pushed a commit to BorisTestov/qmk_firmware that referenced this pull request May 23, 2024
* add some split data to info.json

* add tags

* add half of config_options.md to info.json

* add support for designating master split

* sort out split transport and primary

* fix bad data in UNUSED_PINS

* fixup custom transport

* wip

* allow for setting split right half keyboard matrix

* add SPLIT_USB_DETECT

* minor cleanup

* fix an erroneous message

* rework split.usb_detect

* adding missing rgblight vars to info.json

* add mouse_key to info.json

* add all remaining options from docs/config_options.md

* fix audio voices

* qmk info: Change text output to use dotted notation

* tweak layout output

* resolve alias names

* break out some functions to make flake8 happy

* add a field for bootloader instructions

* qmk generate-info-json: add a write-to-file argument

Adds an argument that instructs qmk generate-info-json to write the output to a file instead of just to the terminal.

* -arg_only, +action

Because it was never my intention that one would have to specify a value for the argument that enables writing the file.

* Bring qmk generate-info-json inline with other generate commands

* pytest fixup

* fix esca/getawayvan

* fix data driven errors for bpiphany converters

* features.force_nkro -> usb.force_nkro

* split.primary->split.main

* fix esca/getawayvan_f042

* fix the bpiphany converters for real

* fix bpiphany/tiger_lily

* Apply suggestions from code review

Co-authored-by: Nick Brassel <[email protected]>

* fix generate-api errors

* fix matrix pin extraction for split boards

* fix ploopyco/trackball_nano/rev1_001

Co-authored-by: James Young <[email protected]>
Co-authored-by: Nick Brassel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants