aboutsummaryrefslogtreecommitdiff
path: root/lib/python/qmk
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/qmk')
-rw-r--r--lib/python/qmk/cli/__init__.py4
-rw-r--r--lib/python/qmk/cli/new/keyboard.py74
-rw-r--r--lib/python/qmk/cli/painter/convert_graphics.py4
-rw-r--r--lib/python/qmk/cli/painter/make_font.py4
-rw-r--r--lib/python/qmk/commands.py2
-rw-r--r--lib/python/qmk/constants.py4
-rw-r--r--lib/python/qmk/info.py3
-rw-r--r--lib/python/qmk/keymap.py29
-rw-r--r--lib/python/qmk/painter.py32
-rw-r--r--lib/python/qmk/search.py40
-rw-r--r--lib/python/qmk/tests/test_cli_commands.py26
-rw-r--r--lib/python/qmk/tests/test_qmk_keymap.py9
12 files changed, 140 insertions, 91 deletions
diff --git a/lib/python/qmk/cli/__init__.py b/lib/python/qmk/cli/__init__.py
index 0baf19a629..2d63dfb447 100644
--- a/lib/python/qmk/cli/__init__.py
+++ b/lib/python/qmk/cli/__init__.py
@@ -207,8 +207,8 @@ def _eprint(errmsg):
# Ubuntu 24.04: 3.12
# void: 3.12
-if sys.version_info[0] != 3 or sys.version_info[1] < 7:
- _eprint('Error: Your Python is too old! Please upgrade to Python 3.7 or later.')
+if sys.version_info[0] != 3 or sys.version_info[1] < 9:
+ _eprint('Error: Your Python is too old! Please upgrade to Python 3.9 or later.')
exit(127)
milc_version = __VERSION__.split('.')
diff --git a/lib/python/qmk/cli/new/keyboard.py b/lib/python/qmk/cli/new/keyboard.py
index b84b130f8e..bd02acf9c8 100644
--- a/lib/python/qmk/cli/new/keyboard.py
+++ b/lib/python/qmk/cli/new/keyboard.py
@@ -8,7 +8,7 @@ from pathlib import Path
from dotty_dict import dotty
from milc import cli
-from milc.questions import choice, question
+from milc.questions import choice, question, yesno
from qmk.git import git_get_username
from qmk.json_schema import load_jsonschema
@@ -131,60 +131,70 @@ def _question(*args, **kwargs):
return ret
-def prompt_keyboard():
- prompt = """{fg_yellow}Name Your Keyboard Project{style_reset_all}
-For more infomation, see:
-https://docs.qmk.fm/hardware_keyboard_guidelines#naming-your-keyboard-project
+def prompt_heading_subheading(heading, subheading):
+ cli.log.info(f"{{fg_yellow}}{heading}{{style_reset_all}}")
+ cli.log.info(subheading)
+
-Keyboard Name? """
+def prompt_keyboard():
+ prompt_heading_subheading("Name Your Keyboard Project", """For more information, see:
+https://docs.qmk.fm/hardware_keyboard_guidelines#naming-your-keyboard-project""")
errmsg = 'Keyboard already exists! Please choose a different name:'
- return _question(prompt, reprompt=errmsg, validate=lambda x: not keyboard(x).exists())
+ return _question("Keyboard Name?", reprompt=errmsg, validate=lambda x: not keyboard(x).exists())
def prompt_user():
- prompt = """
-{fg_yellow}Attribution{style_reset_all}
-Used for maintainer, copyright, etc
+ prompt_heading_subheading("Attribution", "Used for maintainer, copyright, etc.")
-Your GitHub Username? """
- return question(prompt, default=git_get_username())
+ return question("Your GitHub Username?", default=git_get_username())
def prompt_name(def_name):
- prompt = """
-{fg_yellow}More Attribution{style_reset_all}
-Used for maintainer, copyright, etc
+ prompt_heading_subheading("More Attribution", "Used for maintainer, copyright, etc.")
-Your Real Name? """
- return question(prompt, default=def_name)
+ return question("Your Real Name?", default=def_name)
def prompt_layout():
- prompt = """
-{fg_yellow}Pick Base Layout{style_reset_all}
-As a starting point, one of the common layouts can be used to bootstrap the process
+ prompt_heading_subheading("Pick Base Layout", """As a starting point, one of the common layouts can be used to
+bootstrap the process""")
-Default Layout? """
# avoid overwhelming user - remove some?
filtered_layouts = [x for x in available_layouts if not any(xs in x for xs in ['_split', '_blocker', '_tsangan', '_f13'])]
filtered_layouts.append("none of the above")
- return choice(prompt, filtered_layouts, default=len(filtered_layouts) - 1)
+ return choice("Default Layout?", filtered_layouts, default=len(filtered_layouts) - 1)
+
+
+def prompt_mcu_type():
+ prompt_heading_subheading(
+ "What Powers Your Project", """Is your board using a separate development board, such as a Pro Micro,
+or is the microcontroller integrated onto the PCB?
+
+For more information, see:
+https://docs.qmk.fm/compatible_microcontrollers"""
+ )
+
+ return yesno("Using a Development Board?")
+
+
+def prompt_dev_board():
+ prompt_heading_subheading("Select Development Board", """For more information, see:
+https://docs.qmk.fm/compatible_microcontrollers""")
+
+ return choice("Development Board?", dev_boards, default=dev_boards.index("promicro"))
def prompt_mcu():
- prompt = """
-{fg_yellow}What Powers Your Project{style_reset_all}
-For more infomation, see:
-https://docs.qmk.fm/#/compatible_microcontrollers
+ prompt_heading_subheading("Select Microcontroller", """For more information, see:
+https://docs.qmk.fm/compatible_microcontrollers""")
-MCU? """
# remove any options strictly used for compatibility
- filtered_mcu = [x for x in (dev_boards + mcu_types) if not any(xs in x for xs in ['cortex', 'unknown'])]
+ filtered_mcu = [x for x in mcu_types if not any(xs in x for xs in ['cortex', 'unknown'])]
- return choice(prompt, filtered_mcu, default=filtered_mcu.index("atmega32u4"))
+ return choice("Microcontroller?", filtered_mcu, default=filtered_mcu.index("atmega32u4"))
@cli.argument('-kb', '--keyboard', help='Specify the name for the new keyboard directory', arg_only=True, type=keyboard_name)
@@ -211,7 +221,11 @@ def new_keyboard(cli):
user_name = cli.config.new_keyboard.name if cli.config.new_keyboard.name else prompt_user()
real_name = cli.args.realname or cli.config.new_keyboard.name if cli.args.realname or cli.config.new_keyboard.name else prompt_name(user_name)
default_layout = cli.args.layout if cli.args.layout else prompt_layout()
- mcu = cli.args.type if cli.args.type else prompt_mcu()
+
+ if cli.args.type:
+ mcu = cli.args.type
+ else:
+ mcu = prompt_dev_board() if prompt_mcu_type() else prompt_mcu()
config = {}
if mcu in dev_boards:
diff --git a/lib/python/qmk/cli/painter/convert_graphics.py b/lib/python/qmk/cli/painter/convert_graphics.py
index 553c26aa5d..f74d655fd5 100644
--- a/lib/python/qmk/cli/painter/convert_graphics.py
+++ b/lib/python/qmk/cli/painter/convert_graphics.py
@@ -60,9 +60,7 @@ def painter_convert_graphics(cli):
return
# Work out the text substitutions for rendering the output data
- args_str = " ".join((f"--{arg} {getattr(cli.args, arg.replace('-', '_'))}" for arg in ["input", "output", "format", "no-rle", "no-deltas"]))
- command = f"qmk painter-convert-graphics {args_str}"
- subs = generate_subs(cli, out_bytes, image_metadata=metadata, command=command)
+ subs = generate_subs(cli, out_bytes, image_metadata=metadata, command_name="painter_convert_graphics")
# Render and write the header file
header_text = render_header(subs)
diff --git a/lib/python/qmk/cli/painter/make_font.py b/lib/python/qmk/cli/painter/make_font.py
index 19db844931..3e18fd74a5 100644
--- a/lib/python/qmk/cli/painter/make_font.py
+++ b/lib/python/qmk/cli/painter/make_font.py
@@ -61,10 +61,8 @@ def painter_convert_font_image(cli):
return
# Work out the text substitutions for rendering the output data
- args_str = " ".join((f"--{arg} {getattr(cli.args, arg.replace('-', '_'))}" for arg in ["input", "output", "no-ascii", "unicode-glyphs", "format", "no-rle"]))
- command = f"qmk painter-convert-font-image {args_str}"
metadata = {"glyphs": _generate_font_glyphs_list(not cli.args.no_ascii, cli.args.unicode_glyphs)}
- subs = generate_subs(cli, out_bytes, font_metadata=metadata, command=command)
+ subs = generate_subs(cli, out_bytes, font_metadata=metadata, command_name="painter_convert_font_image")
# Render and write the header file
header_text = render_header(subs)
diff --git a/lib/python/qmk/commands.py b/lib/python/qmk/commands.py
index 97d9c5032c..a05b3641b5 100644
--- a/lib/python/qmk/commands.py
+++ b/lib/python/qmk/commands.py
@@ -55,7 +55,7 @@ def parse_configurator_json(configurator_file):
cli.log.error(f'Invalid JSON keymap: {configurator_file} : {e.message}')
maybe_exit(1)
- keyboard = user_keymap['keyboard']
+ keyboard = user_keymap.get('keyboard', None)
aliases = keyboard_alias_definitions()
while keyboard in aliases:
diff --git a/lib/python/qmk/constants.py b/lib/python/qmk/constants.py
index b6f46180b2..e055d3fbc9 100644
--- a/lib/python/qmk/constants.py
+++ b/lib/python/qmk/constants.py
@@ -22,7 +22,7 @@ QMK_FIRMWARE_UPSTREAM = 'qmk/qmk_firmware'
MAX_KEYBOARD_SUBFOLDERS = 5
# Supported processor types
-CHIBIOS_PROCESSORS = 'cortex-m0', 'cortex-m0plus', 'cortex-m3', 'cortex-m4', 'MKL26Z64', 'MK20DX128', 'MK20DX256', 'MK64FX512', 'MK66FX1M0', 'RP2040', 'STM32F042', 'STM32F072', 'STM32F103', 'STM32F303', 'STM32F401', 'STM32F405', 'STM32F407', 'STM32F411', 'STM32F446', 'STM32G431', 'STM32G474', 'STM32H723', 'STM32H733', 'STM32L412', 'STM32L422', 'STM32L432', 'STM32L433', 'STM32L442', 'STM32L443', 'GD32VF103', 'WB32F3G71', 'WB32FQ95'
+CHIBIOS_PROCESSORS = 'cortex-m0', 'cortex-m0plus', 'cortex-m3', 'cortex-m4', 'MKL26Z64', 'MK20DX128', 'MK20DX256', 'MK64FX512', 'MK66FX1M0', 'RP2040', 'STM32F042', 'STM32F072', 'STM32F103', 'STM32F303', 'STM32F401', 'STM32F405', 'STM32F407', 'STM32F411', 'STM32F446', 'STM32G431', 'STM32G474', 'STM32H723', 'STM32H733', 'STM32L412', 'STM32L422', 'STM32L432', 'STM32L433', 'STM32L442', 'STM32L443', 'GD32VF103', 'WB32F3G71', 'WB32FQ95', 'AT32F415'
LUFA_PROCESSORS = 'at90usb162', 'atmega16u2', 'atmega32u2', 'atmega16u4', 'atmega32u4', 'at90usb646', 'at90usb647', 'at90usb1286', 'at90usb1287', None
VUSB_PROCESSORS = 'atmega32a', 'atmega328p', 'atmega328', 'attiny85'
@@ -55,6 +55,7 @@ MCU2BOOTLOADER = {
"GD32VF103": "gd32v-dfu",
"WB32F3G71": "wb32-dfu",
"WB32FQ95": "wb32-dfu",
+ "AT32F415": "at32-dfu",
"atmega16u2": "atmel-dfu",
"atmega32u2": "atmel-dfu",
"atmega16u4": "atmel-dfu",
@@ -93,6 +94,7 @@ BOOTLOADER_VIDS_PIDS = {
'apm32-dfu': {("314b", "0106")},
'gd32v-dfu': {("28e9", "0189")},
'wb32-dfu': {("342d", "dfa0")},
+ 'at32-dfu': {("2e3c", "df11")},
'bootloadhid': {("16c0", "05df")},
'usbasploader': {("16c0", "05dc")},
'usbtinyisp': {("1782", "0c9f")},
diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py
index 82082f5cf0..5dae353538 100644
--- a/lib/python/qmk/info.py
+++ b/lib/python/qmk/info.py
@@ -901,9 +901,6 @@ def arm_processor_rules(info_data, rules):
info_data['platform'] = 'STM32'
elif 'MCU_SERIES' in rules:
info_data['platform'] = rules['MCU_SERIES']
- elif 'ARM_ATSAM' in rules:
- info_data['platform'] = 'ARM_ATSAM'
- info_data['platform_key'] = 'arm_atsam'
return info_data
diff --git a/lib/python/qmk/keymap.py b/lib/python/qmk/keymap.py
index 97c358788a..9dd043c4a8 100644
--- a/lib/python/qmk/keymap.py
+++ b/lib/python/qmk/keymap.py
@@ -29,38 +29,40 @@ __INCLUDES__
* This file was generated by qmk json2c. You may or may not want to
* edit it directly.
*/
-const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-__KEYMAP_GOES_HERE__
-};
-#if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)
-const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
+__KEYMAP_GOES_HERE__
__ENCODER_MAP_GOES_HERE__
-};
-#endif // defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)
-
__MACRO_OUTPUT_GOES_HERE__
+
+#ifdef OTHER_KEYMAP_C
+# include OTHER_KEYMAP_C
+#endif // OTHER_KEYMAP_C
"""
def _generate_keymap_table(keymap_json):
- lines = []
+ lines = ['const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {']
for layer_num, layer in enumerate(keymap_json['layers']):
if layer_num != 0:
lines[-1] = lines[-1] + ','
layer = map(_strip_any, layer)
layer_keys = ', '.join(layer)
lines.append(' [%s] = %s(%s)' % (layer_num, keymap_json['layout'], layer_keys))
+ lines.append('};')
return lines
def _generate_encodermap_table(keymap_json):
- lines = []
+ lines = [
+ '#if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)',
+ 'const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {',
+ ]
for layer_num, layer in enumerate(keymap_json['encoders']):
if layer_num != 0:
lines[-1] = lines[-1] + ','
encoder_keycode_txt = ', '.join([f'ENCODER_CCW_CW({_strip_any(e["ccw"])}, {_strip_any(e["cw"])})' for e in layer])
lines.append(' [%s] = {%s}' % (layer_num, encoder_keycode_txt))
+ lines.extend(['};', '#endif // defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)'])
return lines
@@ -271,8 +273,11 @@ def generate_c(keymap_json):
A sequence of strings containing macros to implement for this keyboard.
"""
new_keymap = DEFAULT_KEYMAP_C
- layer_txt = _generate_keymap_table(keymap_json)
- keymap = '\n'.join(layer_txt)
+
+ keymap = ''
+ if 'layers' in keymap_json and keymap_json['layers'] is not None:
+ layer_txt = _generate_keymap_table(keymap_json)
+ keymap = '\n'.join(layer_txt)
new_keymap = new_keymap.replace('__KEYMAP_GOES_HERE__', keymap)
encodermap = ''
diff --git a/lib/python/qmk/painter.py b/lib/python/qmk/painter.py
index 512a486ce8..ed0372c163 100644
--- a/lib/python/qmk/painter.py
+++ b/lib/python/qmk/painter.py
@@ -3,6 +3,7 @@
import datetime
import math
import re
+from pathlib import Path
from string import Template
from PIL import Image, ImageOps
@@ -137,10 +138,31 @@ def _render_image_metadata(metadata):
return "\n".join(lines)
-def generate_subs(cli, out_bytes, *, font_metadata=None, image_metadata=None, command):
+def command_args_str(cli, command_name):
+ """Given a command name, introspect milc to get the arguments passed in."""
+
+ args = {}
+ max_length = 0
+ for arg_name, was_passed in cli.args_passed[command_name].items():
+ max_length = max(max_length, len(arg_name))
+
+ val = getattr(cli.args, arg_name.replace("-", "_"))
+
+ # do not leak full paths, keep just file name
+ if isinstance(val, Path):
+ val = val.name
+
+ args[arg_name] = val
+
+ return "\n".join(f"// {arg_name.ljust(max_length)} | {val}" for arg_name, val in args.items())
+
+
+def generate_subs(cli, out_bytes, *, font_metadata=None, image_metadata=None, command_name):
if font_metadata is not None and image_metadata is not None:
raise ValueError("Cant generate subs for font and image at the same time")
+ args = command_args_str(cli, command_name)
+
subs = {
"year": datetime.date.today().strftime("%Y"),
"input_file": cli.args.input.name,
@@ -148,7 +170,8 @@ def generate_subs(cli, out_bytes, *, font_metadata=None, image_metadata=None, co
"byte_count": len(out_bytes),
"bytes_lines": render_bytes(out_bytes),
"format": cli.args.format,
- "generator_command": command,
+ "generator_command": command_name.replace("_", "-"),
+ "command_args": args,
}
if font_metadata is not None:
@@ -167,7 +190,7 @@ def generate_subs(cli, out_bytes, *, font_metadata=None, image_metadata=None, co
subs.update({
"generated_type": "image",
"var_prefix": "gfx",
- "generator_command": command,
+ "generator_command": command_name,
"metadata": _render_image_metadata(image_metadata),
})
@@ -183,7 +206,8 @@ license_template = """\
// Copyright ${year} QMK -- generated source code only, ${generated_type} retains original copyright
// SPDX-License-Identifier: GPL-2.0-or-later
-// This file was auto-generated by `${generator_command}`
+// This file was auto-generated by `${generator_command}` with arguments:
+${command_args}
"""
diff --git a/lib/python/qmk/search.py b/lib/python/qmk/search.py
index 6517bb4951..c7bce344ad 100644
--- a/lib/python/qmk/search.py
+++ b/lib/python/qmk/search.py
@@ -239,11 +239,11 @@ def _filter_keymap_targets(target_list: List[KeyboardKeymapDesc], filters: List[
valid_targets = parallel_map(_load_keymap_info, target_list)
function_re = re.compile(r'^(?P<function>[a-zA-Z]+)\((?P<key>[a-zA-Z0-9_\.]+)(,\s*(?P<value>[^#]+))?\)$')
- equals_re = re.compile(r'^(?P<key>[a-zA-Z0-9_\.]+)\s*=\s*(?P<value>[^#]+)$')
+ comparison_re = re.compile(r'^(?P<key>[a-zA-Z0-9_\.]+)\s*(?P<op>[\<\>\!=]=|\<|\>)\s*(?P<value>[^#]+)$')
for filter_expr in filters:
function_match = function_re.match(filter_expr)
- equals_match = equals_re.match(filter_expr)
+ comparison_match = comparison_re.match(filter_expr)
if function_match is not None:
func_name = function_match.group('function').lower()
@@ -259,23 +259,43 @@ def _filter_keymap_targets(target_list: List[KeyboardKeymapDesc], filters: List[
value_str = f", {{fg_cyan}}{value}{{fg_reset}}" if value is not None else ""
cli.log.info(f'Filtering on condition: {{fg_green}}{func_name}{{fg_reset}}({{fg_cyan}}{key}{{fg_reset}}{value_str})...')
- elif equals_match is not None:
- key = equals_match.group('key')
- value = equals_match.group('value')
- cli.log.info(f'Filtering on condition: {{fg_cyan}}{key}{{fg_reset}} == {{fg_cyan}}{value}{{fg_reset}}...')
+ elif comparison_match is not None:
+ key = comparison_match.group('key')
+ op = comparison_match.group('op')
+ value = comparison_match.group('value')
+ cli.log.info(f'Filtering on condition: {{fg_cyan}}{key}{{fg_reset}} {op} {{fg_cyan}}{value}{{fg_reset}}...')
- def _make_filter(k, v):
+ def _make_filter(k, o, v):
expr = fnmatch.translate(v)
rule = re.compile(f'^{expr}$', re.IGNORECASE)
def f(e: KeyboardKeymapDesc):
lhs = e.dotty.get(k)
- lhs = str(False if lhs is None else lhs)
- return rule.search(lhs) is not None
+ rhs = v
+
+ if o in ['<', '>', '<=', '>=']:
+ lhs = int(False if lhs is None else lhs)
+ rhs = int(rhs)
+
+ if o == '<':
+ return lhs < rhs
+ elif o == '>':
+ return lhs > rhs
+ elif o == '<=':
+ return lhs <= rhs
+ elif o == '>=':
+ return lhs >= rhs
+ else:
+ lhs = str(False if lhs is None else lhs)
+
+ if o == '!=':
+ return rule.search(lhs) is None
+ elif o == '==':
+ return rule.search(lhs) is not None
return f
- valid_targets = filter(_make_filter(key, value), valid_targets)
+ valid_targets = filter(_make_filter(key, op, value), valid_targets)
else:
cli.log.warning(f'Unrecognized filter expression: {filter_expr}')
continue
diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py
index f18bd12f82..dd659fe0f2 100644
--- a/lib/python/qmk/tests/test_cli_commands.py
+++ b/lib/python/qmk/tests/test_cli_commands.py
@@ -152,17 +152,16 @@ def test_json2c():
* This file was generated by qmk json2c. You may or may not want to
* edit it directly.
*/
+
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_1x1(KC_A)
};
-#if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)
-const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
-
-};
-#endif // defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)
+#ifdef OTHER_KEYMAP_C
+# include OTHER_KEYMAP_C
+#endif // OTHER_KEYMAP_C
"""
@@ -190,28 +189,21 @@ def test_json2c_stdin():
* This file was generated by qmk json2c. You may or may not want to
* edit it directly.
*/
+
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_1x1(KC_A)
};
-#if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)
-const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
-
-};
-#endif // defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)
+#ifdef OTHER_KEYMAP_C
+# include OTHER_KEYMAP_C
+#endif // OTHER_KEYMAP_C
"""
-def test_json2c_wrong_json():
- result = check_subcommand('json2c', 'keyboards/handwired/pytest/info.json')
- check_returncode(result, [1])
- assert 'Invalid JSON keymap' in result.stdout
-
-
def test_json2c_no_json():
result = check_subcommand('json2c', 'keyboards/handwired/pytest/basic/keymaps/default/keymap.c')
check_returncode(result, [1])
@@ -390,7 +382,7 @@ def test_find_contains():
def test_find_multiple_conditions():
# this is intended to match at least 'crkbd/rev1'
result = check_subcommand(
- 'find', '-f', 'exists(rgb_matrix.split_count)', '-f', 'contains(matrix_pins.cols, B1)', '-f', 'length(matrix_pins.cols, 6)', '-f', 'absent(eeprom.driver)', '-f', 'ws2812.pin=D3', '-p', 'rgb_matrix.split_count', '-p', 'matrix_pins.cols', '-p',
+ 'find', '-f', 'exists(rgb_matrix.split_count)', '-f', 'contains(matrix_pins.cols, B1)', '-f', 'length(matrix_pins.cols, 6)', '-f', 'absent(eeprom.driver)', '-f', 'ws2812.pin == D3', '-p', 'rgb_matrix.split_count', '-p', 'matrix_pins.cols', '-p',
'eeprom.driver', '-p', 'ws2812.pin'
)
check_returncode(result)
diff --git a/lib/python/qmk/tests/test_qmk_keymap.py b/lib/python/qmk/tests/test_qmk_keymap.py
index 7482848eff..80cc679b00 100644
--- a/lib/python/qmk/tests/test_qmk_keymap.py
+++ b/lib/python/qmk/tests/test_qmk_keymap.py
@@ -20,17 +20,16 @@ def test_generate_c_pytest_basic():
* This file was generated by qmk json2c. You may or may not want to
* edit it directly.
*/
+
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(KC_A)
};
-#if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)
-const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
-
-};
-#endif // defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)
+#ifdef OTHER_KEYMAP_C
+# include OTHER_KEYMAP_C
+#endif // OTHER_KEYMAP_C
"""