From 6eeb04c4dd985a9f9de3c9579c3050cc3581fcbc Mon Sep 17 00:00:00 2001 From: PowerfulBacon <26465327+PowerfulBacon@users.noreply.github.com> Date: Thu, 22 Aug 2024 22:38:53 +0100 Subject: [PATCH] Allow initialise to stay --- tools/SnakeCaseUpdate/Program.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tools/SnakeCaseUpdate/Program.cs b/tools/SnakeCaseUpdate/Program.cs index 80e3114d4922a..ca3ab91427ad3 100644 --- a/tools/SnakeCaseUpdate/Program.cs +++ b/tools/SnakeCaseUpdate/Program.cs @@ -13,7 +13,7 @@ static void UpdateFile(string filePath, string oldName, string newName) return; Console.WriteLine($"Updated {oldName} to {newName} in {filePath}"); - //File.WriteAllText(filePath, updated); + File.WriteAllText(filePath, updated); } string basePath = "../../../../../code"; @@ -36,6 +36,10 @@ static void UpdateFile(string filePath, string oldName, string newName) { var funcName = match.Groups[1].Value; + // Fine... you get the right to live + if (funcName == "Initialize") + continue; + if (!string.IsNullOrEmpty(funcName) && funcName.Length >= minFunctionNameLength) { string snakeCaseName = ToSnakeCase(funcName); @@ -44,14 +48,9 @@ static void UpdateFile(string filePath, string oldName, string newName) Console.WriteLine($"Updating function {funcName} to {snakeCaseName} in {file}"); Console.ResetColor(); - // Update function name in the definition - UpdateFile(file, funcName, snakeCaseName); - // Update function references in the entire codebase foreach (var refFile in files) { - if (refFile == file) continue; // Skip the file being updated - UpdateFile(refFile, funcName, snakeCaseName); } }