summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/mappings/info_config.json3
-rw-r--r--data/mappings/info_rules.json5
-rw-r--r--lib/python/qmk/info.py22
3 files changed, 23 insertions, 7 deletions
diff --git a/data/mappings/info_config.json b/data/mappings/info_config.json
index d03f50c51e..66a20e588b 100644
--- a/data/mappings/info_config.json
+++ b/data/mappings/info_config.json
@@ -9,6 +9,7 @@
9 # warn_duplicate: Default `true`. Set to `false` to turn off warning when a value exists in both places 9 # warn_duplicate: Default `true`. Set to `false` to turn off warning when a value exists in both places
10 # deprecated: Default `false`. Set to `true` to turn on warning when a value exists 10 # deprecated: Default `false`. Set to `true` to turn on warning when a value exists
11 # invalid: Default `false`. Set to `true` to generate errors when a value exists 11 # invalid: Default `false`. Set to `true` to generate errors when a value exists
12 # replace_with: use with a key marked deprecated or invalid to designate a replacement
12 "AUDIO_VOICES": {"info_key": "audio.voices", "value_type": "bool"}, 13 "AUDIO_VOICES": {"info_key": "audio.voices", "value_type": "bool"},
13 "BACKLIGHT_BREATHING": {"info_key": "backlight.breathing", "value_type": "bool"}, 14 "BACKLIGHT_BREATHING": {"info_key": "backlight.breathing", "value_type": "bool"},
14 "BREATHING_PERIOD": {"info_key": "backlight.breathing_period", "value_type": "int"}, 15 "BREATHING_PERIOD": {"info_key": "backlight.breathing_period", "value_type": "int"},
@@ -110,7 +111,7 @@
110 "NO_ACTION_MACRO": {"info_key": "_invalid.no_action_macro", "invalid": true}, 111 "NO_ACTION_MACRO": {"info_key": "_invalid.no_action_macro", "invalid": true},
111 "NO_ACTION_FUNCTION": {"info_key": "_invalid.no_action_function", "invalid": true}, 112 "NO_ACTION_FUNCTION": {"info_key": "_invalid.no_action_function", "invalid": true},
112 "DESCRIPTION": {"info_key": "_invalid.usb_description", "invalid": true}, 113 "DESCRIPTION": {"info_key": "_invalid.usb_description", "invalid": true},
113 "DEBOUNCING_DELAY": {"info_key": "_invalid.debouncing_delay", "invalid": true}, 114 "DEBOUNCING_DELAY": {"info_key": "_invalid.debouncing_delay", "invalid": true, replace_with: "DEBOUNCE"},
114 "PREVENT_STUCK_MODIFIERS": {"info_key": "_invalid.prevent_stuck_mods", "invalid": true}, 115 "PREVENT_STUCK_MODIFIERS": {"info_key": "_invalid.prevent_stuck_mods", "invalid": true},
115 "RGBLIGHT_ANIMATIONS": {"info_key": "rgblight.animations.all", "value_type": "bool", "deprecated": true}, 116 "RGBLIGHT_ANIMATIONS": {"info_key": "rgblight.animations.all", "value_type": "bool", "deprecated": true},
116 "QMK_KEYS_PER_SCAN": {"info_key": "qmk.keys_per_scan", "value_type": "int", "deprecated": true}, 117 "QMK_KEYS_PER_SCAN": {"info_key": "qmk.keys_per_scan", "value_type": "int", "deprecated": true},
diff --git a/data/mappings/info_rules.json b/data/mappings/info_rules.json
index 279b5ac213..9fd67f7785 100644
--- a/data/mappings/info_rules.json
+++ b/data/mappings/info_rules.json
@@ -9,6 +9,7 @@
9 # warn_duplicate: Default `true`. Set to `false` to turn off warning when a value exists in both places 9 # warn_duplicate: Default `true`. Set to `false` to turn off warning when a value exists in both places
10 # deprecated: Default `false`. Set to `true` to turn on warning when a value exists 10 # deprecated: Default `false`. Set to `true` to turn on warning when a value exists
11 # invalid: Default `false`. Set to `true` to generate errors when a value exists 11 # invalid: Default `false`. Set to `true` to generate errors when a value exists
12 # replace_with: use with a key marked deprecated or invalid to designate a replacement
12 "BOARD": {"info_key": "board"}, 13 "BOARD": {"info_key": "board"},
13 "BOOTLOADER": {"info_key": "bootloader", "warn_duplicate": false}, 14 "BOOTLOADER": {"info_key": "bootloader", "warn_duplicate": false},
14 "BLUETOOTH": {"info_key": "bluetooth.driver"}, 15 "BLUETOOTH": {"info_key": "bluetooth.driver"},
@@ -32,7 +33,7 @@
32 "STENO_PROTOCOL": {"info_key": "stenography.protocol"}, 33 "STENO_PROTOCOL": {"info_key": "stenography.protocol"},
33 34
34 # Items we want flagged in lint 35 # Items we want flagged in lint
35 "CTPC": {"info_key": "_deprecated.ctpc", "deprecated": true}, 36 "CTPC": {"info_key": "_deprecated.ctpc", "deprecated": true, "replace_with": "CONVERT_TO=proton_c"},
36 "CONVERT_TO_PROTON_C": {"info_key": "_deprecated.ctpc", "deprecated": true}, 37 "CONVERT_TO_PROTON_C": {"info_key": "_deprecated.ctpc", "deprecated": true, "replace_with": "CONVERT_TO=proton_c"},
37 "VIAL_ENABLE": {"info_key": "_invalid.vial", "invalid": true}, 38 "VIAL_ENABLE": {"info_key": "_invalid.vial", "invalid": true},
38} 39}
diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py
index 72424f390e..bc07f68d7b 100644
--- a/lib/python/qmk/info.py
+++ b/lib/python/qmk/info.py
@@ -523,10 +523,17 @@ def _extract_config_h(info_data, config_c):
523 key_type = info_dict.get('value_type', 'raw') 523 key_type = info_dict.get('value_type', 'raw')
524 524
525 try: 525 try:
526 replace_with = info_dict.get('replace_with')
526 if config_key in config_c and info_dict.get('invalid', False): 527 if config_key in config_c and info_dict.get('invalid', False):
527 _log_error(info_data, '%s in config.h is no longer a valid option' % config_key) 528 if replace_with:
529 _log_error(info_data, '%s in config.h is no longer a valid option and should be replaced with %s' % (config_key, replace_with))
530 else:
531 _log_error(info_data, '%s in config.h is no longer a valid option and should be removed' % config_key)
528 elif config_key in config_c and info_dict.get('deprecated', False): 532 elif config_key in config_c and info_dict.get('deprecated', False):
529 _log_warning(info_data, '%s in config.h is deprecated and will be removed at a later date' % config_key) 533 if replace_with:
534 _log_warning(info_data, '%s in config.h is deprecated in favor of %s and will be removed at a later date' % (config_key, replace_with))
535 else:
536 _log_warning(info_data, '%s in config.h is deprecated and will be removed at a later date' % config_key)
530 537
531 if config_key in config_c and info_dict.get('to_json', True): 538 if config_key in config_c and info_dict.get('to_json', True):
532 if dotty_info.get(info_key) and info_dict.get('warn_duplicate', True): 539 if dotty_info.get(info_key) and info_dict.get('warn_duplicate', True):
@@ -589,10 +596,17 @@ def _extract_rules_mk(info_data, rules):
589 key_type = info_dict.get('value_type', 'raw') 596 key_type = info_dict.get('value_type', 'raw')
590 597
591 try: 598 try:
599 replace_with = info_dict.get('replace_with')
592 if rules_key in rules and info_dict.get('invalid', False): 600 if rules_key in rules and info_dict.get('invalid', False):
593 _log_error(info_data, '%s in rules.mk is no longer a valid option' % rules_key) 601 if replace_with:
602 _log_error(info_data, '%s in rules.mk is no longer a valid option and should be replaced with %s' % (rules_key, replace_with))
603 else:
604 _log_error(info_data, '%s in rules.mk is no longer a valid option and should be removed' % rules_key)
594 elif rules_key in rules and info_dict.get('deprecated', False): 605 elif rules_key in rules and info_dict.get('deprecated', False):
595 _log_warning(info_data, '%s in rules.mk is deprecated and will be removed at a later date' % rules_key) 606 if replace_with:
607 _log_warning(info_data, '%s in rules.mk is deprecated in favor of %s and will be removed at a later date' % (rules_key, replace_with))
608 else:
609 _log_warning(info_data, '%s in rules.mk is deprecated and will be removed at a later date' % rules_key)
596 610
597 if rules_key in rules and info_dict.get('to_json', True): 611 if rules_key in rules and info_dict.get('to_json', True):
598 if dotty_info.get(info_key) and info_dict.get('warn_duplicate', True): 612 if dotty_info.get(info_key) and info_dict.get('warn_duplicate', True):