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

[Bug] qmk info -l rendering is broken by \n presence in info.json key labels #99

Closed
noroadsleft opened this issue Sep 26, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@noroadsleft
Copy link
Member

noroadsleft commented Sep 26, 2021

Describe the Bug

Running qmk info -l -kb <keyboard> returns bad data if the label field in the info.json file contains \n.

Either QMK CLI should check for this, or we should enforce not using \n in labels. (How would we even do that?)

 noroadsleft  ~/qmk_firmware/keyboards  (master)
$ qmk info -l -kb idb/idb_60
Keyboard Name: idb 60
Manufacturer: idb Keyboards
Website: https://idb-keyboards.xyz/60
Maintainer: pngu
Keyboard Folder: idb/idb_60
Layouts: LAYOUT, LAYOUT_default
Processor: atmega32u2
Bootloader: atmel-dfu
Layout aliases: LAYOUT_all=LAYOUT
Layout Layout:
┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐
│Es││!
││@
││#
││$
││%
││^
││&
││*
││(
││)
││_
││+
││BS││~
│
└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘
┌────┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌────┐
│Tab ││Q ││W ││E ││R ││T ││Y ││U ││I ││O ││P ││{
││}
││|
\ │
└────┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└────┘
┌─────┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌───────┐
│Caps ││A ││S ││D ││F ││G ││H ││J ││K ││L ││:
││"
││Enter  │
└─────┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└───────┘
┌───┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌─────┐┌──┐
│Shi││>
││Z ││X ││C ││V ││B ││N ││M ││<
││>
││?
││Shift││Fn│
└───┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└─────┘└──┘
┌────┐┌──┐┌────┐┌──────────────────────────┐┌────┐┌──┐┌────┐
│Ctrl││Wi││Alt ││Space                     ││Alt ││Wi││Ctrl│
└────┘└──┘└────┘└──────────────────────────┘└────┘└──┘└────┘
Layout Layout_Default:
┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──────┐
│Es││!
││@
││#
││$
││%
││^
││&
││*
││(
││)
││_
││+
││BS    │
└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──────┘
┌────┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌────┐
│Tab ││Q ││W ││E ││R ││T ││Y ││U ││I ││O ││P ││{
││}
││|
\ │
└────┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└────┘
┌─────┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌───────┐
│Caps ││A ││S ││D ││F ││G ││H ││J ││K ││L ││:
││"
││Enter  │
└─────┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└───────┘
┌───────┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌─────┐┌──┐
│Shift  ││Z ││X ││C ││V ││B ││N ││M ││<
││>
││?
││Shift││Fn│
└───────┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└─────┘└──┘
┌────┐    ┌────┐┌──────────────────────────┐┌────┐    ┌────┐
│Ctrl│    │Alt ││Space                     ││Alt │    │Ctrl│
└────┘    └────┘└──────────────────────────┘└────┘    └────┘

The data:

{
    "keyboard_name": "idb 60",
    "url": "https://idb-keyboards.xyz/60",
    "maintainer": "pngu",
    "layouts": {
        "LAYOUT_default": {
            "layout": [
                {"label":"Esc", "x":0, "y":0},
                {"label":"!\n1", "x":1, "y":0},
                {"label":"@\n2", "x":2, "y":0},
                {"label":"#\n3", "x":3, "y":0},
                {"label":"$\n4", "x":4, "y":0},
                {"label":"%\n5", "x":5, "y":0},
                {"label":"^\n6", "x":6, "y":0},
                {"label":"&\n7", "x":7, "y":0},
                {"label":"*\n8", "x":8, "y":0},
                {"label":"(\n9", "x":9, "y":0},
                {"label":")\n0", "x":10, "y":0},
                {"label":"_\n-", "x":11, "y":0},
                {"label":"+\n=", "x":12, "y":0},
                {"label":"BS", "x":13, "y":0, "w":2.0},
                {"label":"Tab", "x":0, "y":1, "w":1.5},
                {"label":"Q", "x":1.5, "y":1},
                {"label":"W", "x":2.5, "y":1},
                {"label":"E", "x":3.5, "y":1},
                {"label":"R", "x":4.5, "y":1},
                {"label":"T", "x":5.5, "y":1},
                {"label":"Y", "x":6.5, "y":1},
                {"label":"U", "x":7.5, "y":1},
                {"label":"I", "x":8.5, "y":1},
                {"label":"O", "x":9.5, "y":1},
                {"label":"P", "x":10.5, "y":1},
                {"label":"{\n[", "x":11.5, "y":1},
                {"label":"}\n]", "x":12.5, "y":1},
                {"label":"|\n\\", "x":13.5, "y":1, "w":1.5},
                {"label":"Caps Lock", "x":0, "y":2, "w":1.75},
                {"label":"A", "x":1.75, "y":2},
                {"label":"S", "x":2.75, "y":2},
                {"label":"D", "x":3.75, "y":2},
                {"label":"F", "x":4.75, "y":2},
                {"label":"G", "x":5.75, "y":2},
                {"label":"H", "x":6.75, "y":2},
                {"label":"J", "x":7.75, "y":2},
                {"label":"K", "x":8.75, "y":2},
                {"label":"L", "x":9.75, "y":2},
                {"label":":\n;", "x":10.75, "y":2},
                {"label":"\"\n'", "x":11.75, "y":2},
                {"label":"Enter", "x":12.75, "y":2, "w":2.25},
                {"label":"Shift", "x":0, "y":3, "w":2.25},
                {"label":"Z", "x":2.25, "y":3},
                {"label":"X", "x":3.25, "y":3},
                {"label":"C", "x":4.25, "y":3},
                {"label":"V", "x":5.25, "y":3},
                {"label":"B", "x":6.25, "y":3},
                {"label":"N", "x":7.25, "y":3},
                {"label":"M", "x":8.25, "y":3},
                {"label":"<\n,", "x":9.25, "y":3},
                {"label":">\n.", "x":10.25, "y":3},
                {"label":"?\n/", "x":11.25, "y":3},
                {"label":"Shift", "x":12.25, "y":3, "w":1.75},
                {"label":"Fn", "x":14, "y":3},
                {"label":"Ctrl", "x":0, "y":4, "w":1.5},
                {"label":"Alt", "x":2.5, "y":4, "w":1.5},
                {"label":"Space", "x":4, "y":4, "w":7},
                {"label":"Alt", "x":11, "y":4, "w":1.5},
                {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}
            ]
        },
        "LAYOUT": {
            "layout": [
                {"label":"Esc", "x":0, "y":0},
                {"label":"!\n1", "x":1, "y":0},
                {"label":"@\n2", "x":2, "y":0},
                {"label":"#\n3", "x":3, "y":0},
                {"label":"$\n4", "x":4, "y":0},
                {"label":"%\n5", "x":5, "y":0},
                {"label":"^\n6", "x":6, "y":0},
                {"label":"&\n7", "x":7, "y":0},
                {"label":"*\n8", "x":8, "y":0},
                {"label":"(\n9", "x":9, "y":0},
                {"label":")\n0", "x":10, "y":0},
                {"label":"_\n-", "x":11, "y":0},
                {"label":"+\n=", "x":12, "y":0},
                {"label":"BS", "x":13, "y":0},
                {"label":"~\n`", "x":14, "y":0},
                {"label":"Tab", "x":0, "y":1, "w":1.5},
                {"label":"Q", "x":1.5, "y":1},
                {"label":"W", "x":2.5, "y":1},
                {"label":"E", "x":3.5, "y":1},
                {"label":"R", "x":4.5, "y":1},
                {"label":"T", "x":5.5, "y":1},
                {"label":"Y", "x":6.5, "y":1},
                {"label":"U", "x":7.5, "y":1},
                {"label":"I", "x":8.5, "y":1},
                {"label":"O", "x":9.5, "y":1},
                {"label":"P", "x":10.5, "y":1},
                {"label":"{\n[", "x":11.5, "y":1},
                {"label":"}\n]", "x":12.5, "y":1},
                {"label":"|\n\\", "x":13.5, "y":1, "w":1.5},
                {"label":"Caps Lock", "x":0, "y":2, "w":1.75},
                {"label":"A", "x":1.75, "y":2},
                {"label":"S", "x":2.75, "y":2},
                {"label":"D", "x":3.75, "y":2},
                {"label":"F", "x":4.75, "y":2},
                {"label":"G", "x":5.75, "y":2},
                {"label":"H", "x":6.75, "y":2},
                {"label":"J", "x":7.75, "y":2},
                {"label":"K", "x":8.75, "y":2},
                {"label":"L", "x":9.75, "y":2},
                {"label":":\n;", "x":10.75, "y":2},
                {"label":"\"\n'", "x":11.75, "y":2},
                {"label":"Enter", "x":12.75, "y":2, "w":2.25},
                {"label":"Shift", "x":0, "y":3, "w":1.25},
                {"label":">\n<\n\n|", "x":1.25, "y":3},
                {"label":"Z", "x":2.25, "y":3},
                {"label":"X", "x":3.25, "y":3},
                {"label":"C", "x":4.25, "y":3},
                {"label":"V", "x":5.25, "y":3},
                {"label":"B", "x":6.25, "y":3},
                {"label":"N", "x":7.25, "y":3},
                {"label":"M", "x":8.25, "y":3},
                {"label":"<\n,", "x":9.25, "y":3},
                {"label":">\n.", "x":10.25, "y":3},
                {"label":"?\n/", "x":11.25, "y":3},
                {"label":"Shift", "x":12.25, "y":3, "w":1.75},
                {"label":"Fn", "x":14, "y":3},
                {"label":"Ctrl", "x":0, "y":4, "w":1.5},
                {"label":"Win", "x":1.5, "y":4},
                {"label":"Alt", "x":2.5, "y":4, "w":1.5},
                {"label":"Space", "x":4, "y":4, "w":7},
                {"label":"Alt", "x":11, "y":4, "w":1.5},
                {"label":"Win", "x":12.5, "y":4},
                {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}
            ]
        }
    }
}

Additional Context?

https://github.com/qmk/qmk_firmware/blob/03f4c53564550024821aafadef69b5daaaa09abd/keyboards/idb/idb_60/info.json
https://github.com/qmk/qmk_firmware/blob/03f4c53564550024821aafadef69b5daaaa09abd/keyboards/sendyyeah/75pixels/info.json

@mateossh
Copy link

I opened PR with bugfix here

@noroadsleft
Copy link
Member Author

Fixed by qmk/qmk_firmware#14970.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants