Skip to content

Commit f47f81a

Browse files
authored
[projmgr] Fix yml comparison to avoid rewriting files
1 parent f982336 commit f47f81a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/projmgr/src/ProjMgrYamlEmitter.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ bool ProjMgrYamlEmitter::CompareFile(const string& filename, const YAML::Node& r
9292
return false;
9393
}
9494
const YAML::Node& yamlRoot = YAML::LoadFile(filename);
95-
return CompareNodes(yamlRoot, rootNode);
95+
96+
// emit and load rootNode to ensure both comparison sides have the same formatting
97+
YAML::Emitter emitter;
98+
return CompareNodes(yamlRoot, YAML::Load((emitter << rootNode).c_str()));
9699
}
97100

98101
bool ProjMgrYamlEmitter::CompareNodes(const YAML::Node& lhs, const YAML::Node& rhs) {

0 commit comments

Comments
 (0)