[Bug] Update Rule Formatter (#3668)
* Update Rule Formatter
* Only apply fix to Note
(cherry picked from commit 094ef22604)
This commit is contained in:
committed by
github-actions[bot]
parent
2f88a93d62
commit
e45c7db95e
@@ -216,6 +216,11 @@ def toml_write(rule_contents, outfile=None):
|
||||
preserved_fields = ["params.message"]
|
||||
v = [preserve_formatting_for_fields(action, preserved_fields) for action in v]
|
||||
|
||||
if k == 'note' and isinstance(v, str):
|
||||
# Transform instances of \ to \\ as calling write will convert \\ to \.
|
||||
# This will ensure that the output file has the correct number of backslashes.
|
||||
v = v.replace("\\", "\\\\")
|
||||
|
||||
if isinstance(v, dict):
|
||||
bottom[k] = OrderedDict(sorted(v.items()))
|
||||
elif isinstance(v, list):
|
||||
|
||||
Reference in New Issue
Block a user