summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2023-01-07 17:05:53 +0000
committerGitHub <noreply@github.com>2023-01-07 17:05:53 +0000
commit974a1eaf2a1076de0cc06deeefe12e15b7e209bc (patch)
tree9b3f151fa17b2ce923dee1d28e126883c03645ce /lib
parent403c7eeb5c2dd5ff896a228fe3e7832a5c773340 (diff)
Ignore defaults.hjson values if already set (#19511)
* Ignore defaults.hjson values if already set * Add warning when nothing is merged
Diffstat (limited to 'lib')
-rw-r--r--lib/python/qmk/info.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py
index 7e588b5182..86b1e2c063 100644
--- a/lib/python/qmk/info.py
+++ b/lib/python/qmk/info.py
@@ -561,8 +561,16 @@ def _process_defaults(info_data):
for default_type in defaults_map.keys():
thing_map = defaults_map[default_type]
if default_type in info_data:
- for key, value in thing_map.get(info_data[default_type], {}).items():
- info_data[key] = value
+ merged_count = 0
+ thing_items = thing_map.get(info_data[default_type], {}).items()
+ for key, value in thing_items:
+ if key not in info_data:
+ info_data[key] = value
+ merged_count += 1
+
+ if merged_count == 0 and len(thing_items) > 0:
+ _log_warning(info_data, 'All defaults for \'%s\' were skipped, potential redundant config or misconfiguration detected' % (default_type))
+
return info_data