From 742ff7698d25e50d937f17f164fcf2fd47764ce8 Mon Sep 17 00:00:00 2001 From: Daniel Brondani Date: Thu, 31 Jul 2025 12:39:32 +0200 Subject: [PATCH] [projmgr] Fix yml comparison to avoid rewriting files --- tools/projmgr/src/ProjMgrYamlEmitter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/projmgr/src/ProjMgrYamlEmitter.cpp b/tools/projmgr/src/ProjMgrYamlEmitter.cpp index 7d33f05b2..d90f96785 100644 --- a/tools/projmgr/src/ProjMgrYamlEmitter.cpp +++ b/tools/projmgr/src/ProjMgrYamlEmitter.cpp @@ -92,7 +92,10 @@ bool ProjMgrYamlEmitter::CompareFile(const string& filename, const YAML::Node& r return false; } const YAML::Node& yamlRoot = YAML::LoadFile(filename); - return CompareNodes(yamlRoot, rootNode); + + // emit and load rootNode to ensure both comparison sides have the same formatting + YAML::Emitter emitter; + return CompareNodes(yamlRoot, YAML::Load((emitter << rootNode).c_str())); } bool ProjMgrYamlEmitter::CompareNodes(const YAML::Node& lhs, const YAML::Node& rhs) {