From d6b57496a2c40a813408a83a8a3cca10816e5256 Mon Sep 17 00:00:00 2001 From: "lemiller@microsoft.com" Date: Thu, 23 Mar 2023 10:13:40 -0700 Subject: [PATCH 1/3] Disable style rules and VSTHRD111 analyzer in .editorconfig Summary: This commit updates the .editorconfig file to disable all style rules by default for C# files, as they are not relevant for the project and can interfere with the auto-save feature of the IDE. It also disables the VSTHRD111 analyzer, which warns about not using ConfigureAwait(false) in async methods, as this is not needed for the project and can reduce readability. These changes are intended to improve the developer experience and avoid unnecessary warnings. --- .editorconfig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.editorconfig b/.editorconfig index a4d02850edae..138c8e465a76 100644 --- a/.editorconfig +++ b/.editorconfig @@ -110,6 +110,7 @@ dotnet_diagnostic.CA2007.severity = none # Do not directly await a Task dotnet_diagnostic.CA2225.severity = none # Operator overloads have named alternates dotnet_diagnostic.CA2227.severity = none # Change to be read-only by removing the property setter dotnet_diagnostic.CA2253.severity = none # Named placeholders in the logging message template should not be comprised of only numeric characters +dotnet_diagnostic.VSTHRD111.severity = none # Use .ConfigureAwait(bool) is hidden by default, set to none to prevent IDE from changing on autosave # Diagnostics elevated as warnings dotnet_diagnostic.CA1000.severity = warning # Do not declare static members on generic types @@ -248,6 +249,13 @@ csharp_style_prefer_top_level_statements = true:silent csharp_style_expression_bodied_lambdas = true:silent csharp_style_expression_bodied_local_functions = false:silent + +################## +# C# Style # +################## +[*.cs] +dotnet_analyzer_diagnostic.category-Style.severity = none # Disable all unneccesary style rules by default + ############################### # VB Coding Conventions # ############################### From 2b71ac944fb16758f961b3432361835bce0b4252 Mon Sep 17 00:00:00 2001 From: "lemiller@microsoft.com" Date: Thu, 23 Mar 2023 10:14:08 -0700 Subject: [PATCH 2/3] Comment out unused environment variables in launchSettings.json Summary: This commit comments out the environment variables related to Bing and OpenAI APIs in the launchSettings.json file, since they are not used in the current version of the project. This avoids potential confusion and errors when running the project locally or deploying it to a different environment. The variables can be uncommented and updated if needed in the future. --- .../Properties/launchSettings.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/samples/dotnet/kernel-syntax-examples/Properties/launchSettings.json b/samples/dotnet/kernel-syntax-examples/Properties/launchSettings.json index b109df5600ed..a8e32bb67ba6 100644 --- a/samples/dotnet/kernel-syntax-examples/Properties/launchSettings.json +++ b/samples/dotnet/kernel-syntax-examples/Properties/launchSettings.json @@ -3,13 +3,13 @@ "KernelSyntaxExamples": { "commandName": "Project", "environmentVariables": { - "BING_API_KEY": "", - "OPENAI_API_KEY": "", - "AZURE_OPENAI_DEPLOYMENT_LABEL": "azure-text-davinci-002", - "AZURE_OPENAI_DEPLOYMENT_NAME": "text-davinci-002", - "AZURE_OPENAI_ENDPOINT": "", - "AZURE_OPENAI_KEY": "" + // "BING_API_KEY": "", + // "OPENAI_API_KEY": "", + // "AZURE_OPENAI_DEPLOYMENT_LABEL": "azure-text-davinci-002", + // "AZURE_OPENAI_DEPLOYMENT_NAME": "text-davinci-002", + // "AZURE_OPENAI_ENDPOINT": "", + // "AZURE_OPENAI_KEY": "" } } } -} \ No newline at end of file +} From 303ec46b8a499182630d825f06871e69776553d2 Mon Sep 17 00:00:00 2001 From: "lemiller@microsoft.com" Date: Thu, 23 Mar 2023 10:26:40 -0700 Subject: [PATCH 3/3] Disable unnecessary style rules for C# files Summary: This commit updates the .editorconfig file to disable several style rules that are not relevant or useful for the C# code base. These rules include ones that suggest using var, removing unused usings, simplifying names, and removing unused parameters. By disabling these rules, the code base can avoid unnecessary noise and warnings from the analyzers and most importantly, auto updates on file save from IDEs. --- .editorconfig | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 138c8e465a76..343ce06fd235 100644 --- a/.editorconfig +++ b/.editorconfig @@ -253,8 +253,23 @@ csharp_style_expression_bodied_local_functions = false:silent ################## # C# Style # ################## + +# Disable unneccesary style rules by default [*.cs] -dotnet_analyzer_diagnostic.category-Style.severity = none # Disable all unneccesary style rules by default +dotnet_diagnostic.IDE0001.severity = none # Simplify name +dotnet_diagnostic.IDE0002.severity = none # Simplify member access +dotnet_diagnostic.IDE0004.severity = none # Remove unnecessary cast +# dotnet_diagnostic.IDE0005.severity = none # Remove unnecessary usings +dotnet_diagnostic.IDE0035.severity = none # Remove unreachable code +dotnet_diagnostic.IDE0051.severity = none # Remove unused private member +dotnet_diagnostic.IDE0052.severity = none # Remove unread private member +dotnet_diagnostic.IDE0058.severity = none # Remove unused expression value +dotnet_diagnostic.IDE0059.severity = none # Unnecessary assignment of a value +dotnet_diagnostic.IDE0060.severity = none # Remove unused parameter +dotnet_diagnostic.IDE0080.severity = none # Remove unnecessary suppression operator +dotnet_diagnostic.IDE0100.severity = none # Remove unnecessary equality operator +dotnet_diagnostic.IDE0110.severity = none # Remove unnecessary discards + ############################### # VB Coding Conventions #