From da5b26d33f96fa38cc957065b73699f6770e1f1e Mon Sep 17 00:00:00 2001 From: Volker Mische Date: Tue, 14 Apr 2026 09:10:19 +0200 Subject: [PATCH] Add newline at the end of a generated Lexicon file Files usually have newlines at the end. Especially when they are edited manually. In order to prevent pure whitespace changes on newline vs. no newline at the end of the file, always add a newline. --- mlf-cli/src/generate/lexicon.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlf-cli/src/generate/lexicon.rs b/mlf-cli/src/generate/lexicon.rs index 90d21f7..136f7e2 100644 --- a/mlf-cli/src/generate/lexicon.rs +++ b/mlf-cli/src/generate/lexicon.rs @@ -181,7 +181,7 @@ pub fn run(input_paths: Vec, output_dir: Option, explicit_root }; let json_str = serde_json::to_string_pretty(&json_lexicon).unwrap(); - if let Err(source) = std::fs::write(&output_path, json_str) { + if let Err(source) = std::fs::write(&output_path, format!("{}\n", json_str)) { errors.push((output_path.display().to_string(), format!("Failed to write file: {}", source))); continue; } -- 2.51.2