Skip to content

Commit da166d4

Browse files
authored
Add "license" field to Community Module JSON schema. (qmk#25085)
Add "license" field to community module schema.
1 parent 3cd2924 commit da166d4

5 files changed

Lines changed: 13 additions & 3 deletions

File tree

‎data/schemas/community_module.jsonschema‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"properties": {
88
"module_name": {"$ref": "qmk.definitions.v1#/text_identifier"},
99
"maintainer": {"$ref": "qmk.definitions.v1#/text_identifier"},
10+
"license": {"type": "string"},
1011
"url": {
1112
"type": "string",
1213
"format": "uri"

‎docs/features/community_modules.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ A Community Module is denoted by a `qmk_module.json` file such as the following:
7272
{
7373
"module_name": "Hello World",
7474
"maintainer": "QMK Maintainers",
75+
"license": "GPL-2.0-or-later",
7576
"features": {
7677
"deferred_exec": true
7778
},
@@ -86,6 +87,10 @@ A Community Module is denoted by a `qmk_module.json` file such as the following:
8687

8788
At minimum, the module must provide the `module_name` and `maintainer` fields.
8889

90+
The `license` field is encouraged to indicate the terms for using and sharing the module. It is recommended to use a [SPDX license identifier](https://spdx.org/licenses/) like "`Apache-2.0`" or "`GPL-2.0-or-later`" if possible.
91+
92+
The `url` field may specify a URL to more information about the module.
93+
8994
The use of `features` matches the definition normally provided within `keyboard.json` and `info.json`, allowing a module to signal to the build system that it has its own dependencies. In the example above, it enables the _deferred executor_ feature whenever the above module is used in a build.
9095

9196
The `keycodes` array allows a module to provide new keycodes (as well as corresponding aliases) to a keymap.

‎lib/python/qmk/json_encoders.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,14 @@ def sort_dict(self, item):
250250
return '00module_name'
251251
if key == 'maintainer':
252252
return '01maintainer'
253+
if key == 'license':
254+
return '02license'
253255
if key == 'url':
254-
return '02url'
256+
return '03url'
255257
if key == 'features':
256-
return '03features'
258+
return '04features'
257259
if key == 'keycodes':
258-
return '04keycodes'
260+
return '05keycodes'
259261
elif self.indentation_level == 3: # keycodes
260262
if key == 'key':
261263
return '00key'

‎modules/qmk/hello_world/qmk_module.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"module_name": "Hello World",
33
"maintainer": "QMK Maintainers",
4+
"license": "GPL-2.0-or-later",
45
"features": {
56
"console": true,
67
"deferred_exec": true

‎modules/qmk/super_alt_tab/qmk_module.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"module_name": "Super Alt Tab",
33
"maintainer": "QMK Maintainers",
4+
"license": "GPL-2.0-or-later",
45
"keycodes": [
56
{
67
"key": "COMMUNITY_MODULE_SUPER_ALT_TAB",

0 commit comments

Comments
 (0)