summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2024-01-16 17:13:58 +1100
committerGitHub <noreply@github.com>2024-01-16 17:13:58 +1100
commit2b0965944d9065daa65cd25540cf2dd007f23eda (patch)
treeea42dece021fe725404351ce0195a1f20734c4bd /lib
parenta522b1f15627c69f94cbc814968be5a63519b8e3 (diff)
`qmk format-json`: Force Unix line endings and ensure LF at EOF (#22901)
Diffstat (limited to 'lib')
-rwxr-xr-xlib/python/qmk/cli/format/json.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/python/qmk/cli/format/json.py b/lib/python/qmk/cli/format/json.py
index 283513254c..87a3837d10 100755
--- a/lib/python/qmk/cli/format/json.py
+++ b/lib/python/qmk/cli/format/json.py
@@ -92,8 +92,8 @@ def format_json(cli):
output = json.dumps(json_data, cls=json_encoder, sort_keys=True)
if cli.args.inplace:
- with open(cli.args.json_file, 'w+', encoding='utf-8') as outfile:
- outfile.write(output)
+ with open(cli.args.json_file, 'w+', encoding='utf-8', newline='\n') as outfile:
+ outfile.write(output + '\n')
# Display the results if print was set
# We don't operate in-place by default, so also display to stdout