summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2022-06-10 11:44:23 +0100
committerGitHub <noreply@github.com>2022-06-10 11:44:23 +0100
commit7baf9b3f357abe314fcd02e01c814f9516d66e89 (patch)
tree91598b72a23500f17e081601d56fcb2ef1886d55
parentd8ace624c8e6a3e5e49ad5f612f5222cb766542a (diff)
Promote label with newlines to lint error (#17347)
-rw-r--r--data/schemas/keyboard.jsonschema5
-rw-r--r--keyboards/sendyyeah/75pixels/info.json28
-rw-r--r--lib/python/qmk/info.py10
3 files changed, 18 insertions, 25 deletions
diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema
index dc5592220b..fd60920578 100644
--- a/data/schemas/keyboard.jsonschema
+++ b/data/schemas/keyboard.jsonschema
@@ -145,7 +145,10 @@
"type": "object",
"additionalProperties": false,
"properties": {
- "label": {"type": "string"},
+ "label": {
+ "type": "string",
+ "pattern": "^[^\\n]*$"
+ },
"matrix": {
"type": "array",
"minItems": 2,
diff --git a/keyboards/sendyyeah/75pixels/info.json b/keyboards/sendyyeah/75pixels/info.json
index 193beb6532..6fb65c1d88 100644
--- a/keyboards/sendyyeah/75pixels/info.json
+++ b/keyboards/sendyyeah/75pixels/info.json
@@ -31,10 +31,10 @@
{"label": "I", "x": 8, "y": 1},
{"label": "O", "x": 9, "y": 1},
{"label": "P", "x": 10, "y": 1},
- {"label": "|\n\\", "x": 11, "y": 1},
- {"label": "7\nHome", "x": 12, "y": 1},
- {"label": "8\nUp", "x": 13, "y": 1},
- {"label": "9\nPgUp", "x": 14, "y": 1},
+ {"label": "|", "x": 11, "y": 1},
+ {"label": "7", "x": 12, "y": 1},
+ {"label": "8", "x": 13, "y": 1},
+ {"label": "9", "x": 14, "y": 1},
{"label": "Caps", "x": 0, "y": 2},
{"label": "A", "x": 1, "y": 2},
{"label": "S", "x": 2, "y": 2},
@@ -47,9 +47,9 @@
{"label": "L", "x": 9, "y": 2},
{"label": ":", "x": 10, "y": 2},
{"label": "Enter", "x": 11, "y": 2},
- {"label": "4\nLeft", "x": 12, "y": 2},
+ {"label": "4", "x": 12, "y": 2},
{"label": "5", "x": 13, "y": 2},
- {"label": "6\nRight", "x": 14, "y": 2},
+ {"label": "6", "x": 14, "y": 2},
{"label": "Shift", "x": 0, "y": 3},
{"label": "Z", "x": 1, "y": 3},
{"label": "X", "x": 2, "y": 3},
@@ -58,13 +58,13 @@
{"label": "B", "x": 5, "y": 3},
{"label": "N", "x": 6, "y": 3},
{"label": "M", "x": 7, "y": 3},
- {"label": "<\n,", "x": 8, "y": 3},
- {"label": ">\n.", "x": 9, "y": 3},
- {"label": "?\n/", "x": 10, "y": 3},
+ {"label": "<", "x": 8, "y": 3},
+ {"label": ">", "x": 9, "y": 3},
+ {"label": "?", "x": 10, "y": 3},
{"label": "Shift", "x": 11, "y": 3},
- {"label": "1\nEnd", "x": 12, "y": 3},
- {"label": "2\nDown", "x": 13, "y": 3},
- {"label": "3\nPgDn", "x": 14, "y": 3},
+ {"label": "1", "x": 12, "y": 3},
+ {"label": "2", "x": 13, "y": 3},
+ {"label": "3", "x": 14, "y": 3},
{"label": "Ctrl", "x": 0, "y": 4},
{"label": "Win", "x": 1, "y": 4},
{"label": "Alt", "x": 2, "y": 4},
@@ -77,8 +77,8 @@
{"label": "Win", "x": 9, "y": 4},
{"label": "Menu", "x": 10, "y": 4},
{"label": "Ctrl", "x": 11, "y": 4},
- {"label": "0\nIns", "x": 12, "y": 4},
- {"label": ".\nDel", "x": 13, "y": 4},
+ {"label": "0", "x": 12, "y": 4},
+ {"label": ".", "x": 13, "y": 4},
{"label": "Enter", "x": 14, "y": 4}
]
}
diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py
index 6ff9cba45b..dd753f328c 100644
--- a/lib/python/qmk/info.py
+++ b/lib/python/qmk/info.py
@@ -26,13 +26,6 @@ def _valid_community_layout(layout):
return (Path('layouts/default') / layout).exists()
-def _remove_newlines_from_labels(layouts):
- for layout_name, layout_json in layouts.items():
- for key in layout_json['layout']:
- if '\n' in key['label']:
- key['label'] = key['label'].split('\n')[0]
-
-
def info_json(keyboard):
"""Generate the info.json data for a specific keyboard.
"""
@@ -111,9 +104,6 @@ def info_json(keyboard):
# Check that the reported matrix size is consistent with the actual matrix size
_check_matrix(info_data)
- # Remove newline characters from layout labels
- _remove_newlines_from_labels(layouts)
-
return info_data