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

Remove references to info.json width and height in CLI #13728

Merged
merged 3 commits into from
Jul 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions data/schemas/keyboard.jsonschema
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
"enum": ["COL2ROW", "ROW2COL"]
},
"debounce": {"$ref": "qmk.definitions.v1#/unsigned_int"},
"height": {"$ref": "qmk.definitions.v1#/key_unit"},
"width": {"$ref": "qmk.definitions.v1#/key_unit"},
"community_layouts": {
"type": "array",
"items": {"$ref": "qmk.definitions.v1#/filename"}
Expand Down
2 changes: 0 additions & 2 deletions docs/ja/reference_configurator_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ JSON ファイルをビルドする最も簡単な方法は、[Keyboard Layout E
"tags": {
"form_factor": "numpad"
},
"width": 4,
"height": 5,
"layouts": {
"LAYOUT": {
"layout": [
Expand Down
4 changes: 0 additions & 4 deletions docs/ja/reference_info_json.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
* キーボードの製品ページ、[QMK.fm/keyboards](https://qmk.fm/keyboards) のページ、あるいはキーボードに関する情報を説明する他のページの URL。
* `maintainer`
* メンテナの GitHub のユーザ名、あるいはコミュニティが管理するキーボードの場合は `qmk`
* `width`
* キー単位でのキーボードの幅
* `height`
* キー単位でのキーボードの高さ
* `layouts`
* 物理的なレイアウト表現。詳細は以下のセクションを見てください。

Expand Down
2 changes: 0 additions & 2 deletions docs/reference_configurator_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ Use the `keyboard_name` object to set the name of the keyboard. For instruction
"tags": {
"form_factor": "numpad"
},
"width": 4,
"height": 5,
"layouts": {
"LAYOUT": {
"layout": [
Expand Down
4 changes: 0 additions & 4 deletions docs/reference_info_json.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ The `info.json` file is a JSON formatted dictionary with the following keys avai
* A URL to the keyboard's product page, [QMK.fm/keyboards](https://qmk.fm/keyboards) page, or other page describing information about the keyboard.
* `maintainer`
* GitHub username of the maintainer, or `qmk` for community maintained boards
* `width`
* Width of the board in Key Units
* `height`
* Height of the board in Key Units
* `debounce`
* How many milliseconds (ms) to wait for debounce to happen. (Default: 5)
* `diode_direction`
Expand Down
2 changes: 0 additions & 2 deletions lib/python/qmk/cli/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ def print_friendly_output(kb_info_json):
cli.echo('{fg_blue}Maintainer{fg_reset}: %s', kb_info_json['maintainer'])
cli.echo('{fg_blue}Keyboard Folder{fg_reset}: %s', kb_info_json.get('keyboard_folder', 'Unknown'))
cli.echo('{fg_blue}Layouts{fg_reset}: %s', ', '.join(sorted(kb_info_json['layouts'].keys())))
if 'width' in kb_info_json and 'height' in kb_info_json:
cli.echo('{fg_blue}Size{fg_reset}: %s x %s' % (kb_info_json['width'], kb_info_json['height']))
cli.echo('{fg_blue}Processor{fg_reset}: %s', kb_info_json.get('processor', 'Unknown'))
cli.echo('{fg_blue}Bootloader{fg_reset}: %s', kb_info_json.get('bootloader', 'Unknown'))
if 'layout_aliases' in kb_info_json:
Expand Down
2 changes: 0 additions & 2 deletions lib/python/qmk/cli/kle2json.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ def kle2json(cli):
'keyboard_name': kle.name,
'url': '',
'maintainer': 'qmk',
'width': kle.columns,
'height': kle.rows,
'layouts': {
'LAYOUT': {
'layout': kle2qmk(kle)
Expand Down
3 changes: 0 additions & 3 deletions lib/python/qmk/json_encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ def sort_dict(self, key):
elif key == 'maintainer':
return '12maintainer'

elif key in ('height', 'width'):
return '40' + str(key)

elif key == 'community_layouts':
return '97community_layouts'

Expand Down
2 changes: 0 additions & 2 deletions lib/python/qmk/tests/minimal_info.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"keyboard_name": "tester",
"maintainer": "qmk",
"height": 5,
"width": 15,
"layouts": {
"LAYOUT": {
"layout": [
Expand Down
4 changes: 2 additions & 2 deletions lib/python/qmk/tests/test_cli_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def test_generate_layouts():
def test_format_json_keyboard():
result = check_subcommand('format-json', '--format', 'keyboard', 'lib/python/qmk/tests/minimal_info.json')
check_returncode(result)
assert result.stdout == '{\n "keyboard_name": "tester",\n "maintainer": "qmk",\n "height": 5,\n "width": 15,\n "layouts": {\n "LAYOUT": {\n "layout": [\n { "label": "KC_A", "matrix": [0, 0], "x": 0, "y": 0 }\n ]\n }\n }\n}\n'
assert result.stdout == '{\n "keyboard_name": "tester",\n "maintainer": "qmk",\n "layouts": {\n "LAYOUT": {\n "layout": [\n { "label": "KC_A", "matrix": [0, 0], "x": 0, "y": 0 }\n ]\n }\n }\n}\n'


def test_format_json_keymap():
Expand All @@ -285,7 +285,7 @@ def test_format_json_keymap():
def test_format_json_keyboard_auto():
result = check_subcommand('format-json', '--format', 'auto', 'lib/python/qmk/tests/minimal_info.json')
check_returncode(result)
assert result.stdout == '{\n "keyboard_name": "tester",\n "maintainer": "qmk",\n "height": 5,\n "width": 15,\n "layouts": {\n "LAYOUT": {\n "layout": [\n { "label": "KC_A", "matrix": [0, 0], "x": 0, "y": 0 }\n ]\n }\n }\n}\n'
assert result.stdout == '{\n "keyboard_name": "tester",\n "maintainer": "qmk",\n "layouts": {\n "LAYOUT": {\n "layout": [\n { "label": "KC_A", "matrix": [0, 0], "x": 0, "y": 0 }\n ]\n }\n }\n}\n'


def test_format_json_keymap_auto():
Expand Down