From a60ef3b2e1205f3e91151db81ba724c3c4a03bc9 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 24 Oct 2024 10:47:17 +0100 Subject: [PATCH] Prevent amalgamate.py from adding trailing whitespace When adding the license text, only add leading whitespace to non-empty lines, otherwise it becomes trailing whitespace. --- script/amalgamate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/script/amalgamate.py b/script/amalgamate.py index ced3f6bd..35659226 100644 --- a/script/amalgamate.py +++ b/script/amalgamate.py @@ -27,7 +27,10 @@ text = '' for line in lines: - text += '// ' + line.strip() + '\n' + line = line.strip() + if len(line): + line = ' ' + line + text += '//' + line + '\n' processed_files[filename] = text # code