From c7367b70650abb2dfbe1741d173da0985791d0b4 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Mon, 12 Sep 2022 23:13:59 +0200 Subject: [PATCH] chore(dotnet): no nested namespace in transport channels (#17273) --- utils/doclint/generateDotnetApi.js | 5 ----- utils/generate_dotnet_channels.js | 7 +++---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/utils/doclint/generateDotnetApi.js b/utils/doclint/generateDotnetApi.js index b129598bf0..8dc7c3460e 100644 --- a/utils/doclint/generateDotnetApi.js +++ b/utils/doclint/generateDotnetApi.js @@ -226,11 +226,6 @@ for (const [name, type] of modelTypes) for (const [name, literals] of enumTypes) renderEnum(name, literals); -if (process.argv[3] !== '--skip-format') { - // run the formatting tool for .NET, to ensure the files are prepped - execSync(`dotnet format "${outputDir}"`); -} - /** * @param {string} name */ diff --git a/utils/generate_dotnet_channels.js b/utils/generate_dotnet_channels.js index 6852ffda57..8a65e64697 100644 --- a/utils/generate_dotnet_channels.js +++ b/utils/generate_dotnet_channels.js @@ -209,11 +209,10 @@ function writeCSharpClass(className, inheritFrom, serializedProperties) { channels_ts.push('using System.Collections.Generic;'); channels_ts.push('using System.Text.Json.Serialization;'); channels_ts.push(``); - channels_ts.push(`namespace Microsoft.Playwright.Transport.Protocol`); - channels_ts.push(`{`); - channels_ts.push(` internal class ${className}${inheritFrom ? ' : ' + inheritFrom : ''}`); + channels_ts.push(`namespace Microsoft.Playwright.Transport.Protocol;`); + channels_ts.push(``); + channels_ts.push(`internal class ${className}${inheritFrom ? ' : ' + inheritFrom : ''}`); channels_ts.push(serializedProperties); - channels_ts.push(`}`); channels_ts.push(``); writeFile(`${className}.cs`, channels_ts.join('\n')); }