Skip to content

Commit

Permalink
Rules/analyzer fixes (microsoft#3328)
Browse files Browse the repository at this point in the history
  • Loading branch information
krschau authored Jul 9, 2024
1 parent 3fcbe47 commit 9576647
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 37 deletions.
15 changes: 8 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -211,17 +210,19 @@ 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
dotnet_naming_rule.private_fields_must_begin_with_underscore_and_be_in_camel_case.style = require_underscore_prefix_and_camel_case
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@
<ProjectReference Include="..\HyperVExtension.HostGuestCommunication\HyperVExtension.HostGuestCommunication.csproj" />
<ProjectReference Include="..\Telemetry\HyperVExtension.Telemetry.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ReferenceCopyLocalPaths Include="$(ProjectDir)..\DevSetupEngineIdl\bin\$(Platform)\$(Configuration)\\Microsoft.Windows.DevHome.DevSetupEngine.winmd" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,6 @@
<ProjectReference Include="..\Telemetry\HyperVExtension.Telemetry.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<!--
Copy DevSetupAgent_<Patform>.zip to the output directory so it picked up by MSIX packaging.
If building from the build script the zip file should exist as it's created as part of the script execution.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.3" />
<PackageReference Include="Serilog" Version="3.1.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,4 @@
<ItemGroup>
<ProjectReference Include="..\HyperVExtension.Common\HyperVExtension.Common.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\HyperVExtension.Common\HyperVExtension.Common.csproj" />
<ProjectReference Include="..\..\src\HyperVExtension\HyperVExtension.csproj" />
Expand Down

0 comments on commit 9576647

Please sign in to comment.