From 9576647235d9104ecc86f142a85fe17969cd49e6 Mon Sep 17 00:00:00 2001
From: Kristen Schau <47155823+krschau@users.noreply.github.com>
Date: Tue, 9 Jul 2024 15:31:25 -0400
Subject: [PATCH] Rules/analyzer fixes (#3328)
---
.editorconfig | 15 ++++++++-------
.../src/DevSetupAgent/DevSetupAgent.csproj | 6 ------
.../src/HyperVExtension/HyperVExtension.csproj | 7 -------
.../HyperVExtensionServer.csproj | 4 ----
.../Telemetry/HyperVExtension.Telemetry.csproj | 7 -------
.../HyperVExtension.UnitTest.csproj | 6 ------
6 files changed, 8 insertions(+), 37 deletions(-)
diff --git a/.editorconfig b/.editorconfig
index 14d319a810..c25d5a04a4 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -128,6 +128,9 @@ csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
+csharp_style_prefer_method_group_conversion = true:silent
+csharp_style_prefer_top_level_statements = true:silent
+csharp_style_prefer_primary_constructors = true:silent
[*.{cs,vb}]
dotnet_style_operator_placement_when_wrapping = beginning_of_line
@@ -189,10 +192,6 @@ dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
-dotnet_naming_style.pascal_case.required_prefix =
-dotnet_naming_style.pascal_case.required_suffix =
-dotnet_naming_style.pascal_case.word_separator =
-dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
@@ -211,8 +210,9 @@ dotnet_naming_symbols.const_private_fields.required_modifiers = const
dotnet_naming_style.require_underscore_prefix_and_camel_case.required_prefix = _
dotnet_naming_style.require_underscore_prefix_and_camel_case.capitalization = camel_case
-dotnet_naming_style.requre_no_prefix_and_pascal_case.required_prefix =
-dotnet_naming_style.requre_no_prefix_and_pascal_case.capitalization = pascal_case
+# Define rule that something must not begin with an underscore and be in pascal case
+dotnet_naming_style.require_no_prefix_and_pascal_case.required_prefix =
+dotnet_naming_style.require_no_prefix_and_pascal_case.capitalization = pascal_case
# Appy our rule to private fields.
dotnet_naming_rule.private_fields_must_begin_with_underscore_and_be_in_camel_case.symbols = private_fields
@@ -220,8 +220,9 @@ dotnet_naming_rule.private_fields_must_begin_with_underscore_and_be_in_camel_cas
dotnet_naming_rule.private_fields_must_begin_with_underscore_and_be_in_camel_case.severity = warning
dotnet_naming_rule.const_fields_must_begin_with_no_prefix_and_be_in_pascal_case.symbols = const_private_fields
-dotnet_naming_rule.const_fields_must_begin_with_no_prefix_and_be_in_pascal_case.style = requre_no_prefix_and_pascal_case
+dotnet_naming_rule.const_fields_must_begin_with_no_prefix_and_be_in_pascal_case.style = require_no_prefix_and_pascal_case
dotnet_naming_rule.const_fields_must_begin_with_no_prefix_and_be_in_pascal_case.severity = warning
+
# Spelling
spelling_exclusion_path = .\exclusion.dic
diff --git a/extensions/HyperVExtension/src/DevSetupAgent/DevSetupAgent.csproj b/extensions/HyperVExtension/src/DevSetupAgent/DevSetupAgent.csproj
index 99eeb1b98a..8318ef70a6 100644
--- a/extensions/HyperVExtension/src/DevSetupAgent/DevSetupAgent.csproj
+++ b/extensions/HyperVExtension/src/DevSetupAgent/DevSetupAgent.csproj
@@ -59,12 +59,6 @@
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
diff --git a/extensions/HyperVExtension/src/HyperVExtension/HyperVExtension.csproj b/extensions/HyperVExtension/src/HyperVExtension/HyperVExtension.csproj
index 0cd01022fb..7cc65e2016 100644
--- a/extensions/HyperVExtension/src/HyperVExtension/HyperVExtension.csproj
+++ b/extensions/HyperVExtension/src/HyperVExtension/HyperVExtension.csproj
@@ -61,13 +61,6 @@
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-