summaryrefslogtreecommitdiffstats
path: root/lib/python/qmk/cli/generate/rules_mk.py
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2022-03-05 00:25:24 +1100
committerGitHub <noreply@github.com>2022-03-04 13:25:24 +0000
commitace0603f4f060783ea91c224c0caec6c1b799f15 (patch)
treee97bc1c3e37d11e7daa0c4a1e5db0dacb5f01475 /lib/python/qmk/cli/generate/rules_mk.py
parentf634fddd344a456c3eff8014d9d58a2d764d7a8c (diff)
Change data driven "str" type to represent a quoted string literal (#16516)
* Change data driven "str" type to represent a quoted string literal * Update docs
Diffstat (limited to 'lib/python/qmk/cli/generate/rules_mk.py')
-rwxr-xr-xlib/python/qmk/cli/generate/rules_mk.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/python/qmk/cli/generate/rules_mk.py b/lib/python/qmk/cli/generate/rules_mk.py
index ce824f6378..a1b10cc945 100755
--- a/lib/python/qmk/cli/generate/rules_mk.py
+++ b/lib/python/qmk/cli/generate/rules_mk.py
@@ -19,7 +19,7 @@ def process_mapping_rule(kb_info_json, rules_key, info_dict):
return None
info_key = info_dict['info_key']
- key_type = info_dict.get('value_type', 'str')
+ key_type = info_dict.get('value_type', 'raw')
try:
rules_value = kb_info_json[info_key]
@@ -32,6 +32,8 @@ def process_mapping_rule(kb_info_json, rules_key, info_dict):
return f'{rules_key} ?= {"yes" if rules_value else "no"}'
elif key_type == 'mapping':
return '\n'.join([f'{key} ?= {value}' for key, value in rules_value.items()])
+ elif key_type == 'str':
+ return f'{rules_key} ?= "{rules_value}"'
return f'{rules_key} ?= {rules_value}'