diff options
author | Ryan <fauxpark@gmail.com> | 2022-08-06 22:37:40 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-06 22:37:40 +1000 |
commit | 37345e2ace56e1ea17e0ab6b4df3af81f437ae79 (patch) | |
tree | e9c91c998377b98e6b9dc8d03b50193e58bf7061 /lib/python/qmk/info.py | |
parent | 0ff8c4f6fd8cce95d9e96060121208f85b4d02cd (diff) | |
download | qmk_firmware-37345e2ace56e1ea17e0ab6b4df3af81f437ae79.tar.gz qmk_firmware-37345e2ace56e1ea17e0ab6b4df3af81f437ae79.zip |
Provide users with replacements for deprecated/invalid functionality where applicable (#17604)
Diffstat (limited to 'lib/python/qmk/info.py')
-rw-r--r-- | lib/python/qmk/info.py | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index 340969f415..ccec46ce21 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py @@ -463,10 +463,17 @@ def _extract_config_h(info_data, config_c): key_type = info_dict.get('value_type', 'raw') try: + replace_with = info_dict.get('replace_with') if config_key in config_c and info_dict.get('invalid', False): - _log_error(info_data, '%s in config.h is no longer a valid option' % config_key) + if replace_with: + _log_error(info_data, '%s in config.h is no longer a valid option and should be replaced with %s' % (config_key, replace_with)) + else: + _log_error(info_data, '%s in config.h is no longer a valid option and should be removed' % config_key) elif config_key in config_c and info_dict.get('deprecated', False): - _log_warning(info_data, '%s in config.h is deprecated and will be removed at a later date' % config_key) + if replace_with: + _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)) + else: + _log_warning(info_data, '%s in config.h is deprecated and will be removed at a later date' % config_key) if config_key in config_c and info_dict.get('to_json', True): if dotty_info.get(info_key) and info_dict.get('warn_duplicate', True): @@ -527,10 +534,17 @@ def _extract_rules_mk(info_data, rules): key_type = info_dict.get('value_type', 'raw') try: + replace_with = info_dict.get('replace_with') if rules_key in rules and info_dict.get('invalid', False): - _log_error(info_data, '%s in rules.mk is no longer a valid option' % rules_key) + if replace_with: + _log_error(info_data, '%s in rules.mk is no longer a valid option and should be replaced with %s' % (rules_key, replace_with)) + else: + _log_error(info_data, '%s in rules.mk is no longer a valid option and should be removed' % rules_key) elif rules_key in rules and info_dict.get('deprecated', False): - _log_warning(info_data, '%s in rules.mk is deprecated and will be removed at a later date' % rules_key) + if replace_with: + _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)) + else: + _log_warning(info_data, '%s in rules.mk is deprecated and will be removed at a later date' % rules_key) if rules_key in rules and info_dict.get('to_json', True): if dotty_info.get(info_key) and info_dict.get('warn_duplicate', True): |