From 520b529ad575a8a6caffc3e0a8a061171b856b09 Mon Sep 17 00:00:00 2001 From: David Kallesen Date: Wed, 15 Nov 2023 14:47:33 +0100 Subject: [PATCH] chore: Update coding-rules to .net8 and update anzlyzers --- .editorconfig | 13 ++++++++++--- Directory.Build.props | 8 ++++---- atc-coding-rules-updater.json | 29 +++++++++++++++++++++++------ sample/.editorconfig | 6 +++--- src/.editorconfig | 6 +++--- src/Directory.Build.props | 2 +- test/.editorconfig | 6 +++--- test/Directory.Build.props | 4 ++-- 8 files changed, 49 insertions(+), 25 deletions(-) diff --git a/.editorconfig b/.editorconfig index 0c58012..b754990 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,8 +1,8 @@ # ATC coding rules - https://github.com/atc-net/atc-coding-rules -# Version: 1.0.9 -# Updated: 01-02-2022 +# Version: 1.0.0 +# Updated: 25-09-2023 # Location: Root -# Distribution: DotNet6 +# Distribution: DotNet8 # Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options ########################################## @@ -87,6 +87,7 @@ dotnet_separate_import_directive_groups = false # .NET Code Style Settings # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#net-code-style-settings [*.{cs,csx,cake}] + # "this." and "Me." qualifiers # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#this-and-me dotnet_style_qualification_for_field = false @@ -146,12 +147,17 @@ dotnet_style_operator_placement_when_wrapping = end_of_line # C# Code Style Settings # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-code-style-settings [*.{cs,csx,cake}] + # Implicit and explicit types # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#implicit-and-explicit-types csharp_style_var_for_built_in_types = true # IDE0007 and IDE0008 csharp_style_var_when_type_is_apparent = true # IDE0007 and IDE0008 csharp_style_var_elsewhere = true # IDE0007 and IDE0008 +# Namespace declaration preferences +# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0160-ide0161?view=vs-2022 +csharp_style_namespace_declarations = file_scoped # IDE0160 and IDE0161 + # Expression-bodied members # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-bodied-members csharp_style_expression_bodied_constructors = when_on_single_line # IDE0021 @@ -457,6 +463,7 @@ dotnet_diagnostic.CA1014.severity = none # https://github.com/atc-net dotnet_diagnostic.CA1068.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1068.md dotnet_diagnostic.CA1707.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1707.md dotnet_diagnostic.CA2007.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA2007.md +dotnet_diagnostic.IDE0005.severity = warning # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0005.md dotnet_diagnostic.IDE0058.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0058.md diff --git a/Directory.Build.props b/Directory.Build.props index 3108704..56c5293 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -41,12 +41,12 @@ - + - - + + - + \ No newline at end of file diff --git a/atc-coding-rules-updater.json b/atc-coding-rules-updater.json index 2934178..88137bd 100644 --- a/atc-coding-rules-updater.json +++ b/atc-coding-rules-updater.json @@ -1,7 +1,24 @@ -{ - "Mappings": { - "Sample": { "Paths": [ "sample" ] }, - "Src": { "Paths": [ "src" ] }, - "Test": { "Paths": [ "test" ] } - } +{ + "projectTarget": "DotNet8", + "useLatestMinorNugetVersion": true, + "useTemporarySuppressions": false, + "temporarySuppressionAsExcel": false, + "analyzerProviderCollectingMode": "LocalCache", + "mappings": { + "sample": { + "paths": [ + "sample" + ] + }, + "src": { + "paths": [ + "src" + ] + }, + "test": { + "paths": [ + "test" + ] + } + } } \ No newline at end of file diff --git a/sample/.editorconfig b/sample/.editorconfig index e777d03..62ffd2f 100644 --- a/sample/.editorconfig +++ b/sample/.editorconfig @@ -1,8 +1,8 @@ # ATC coding rules - https://github.com/atc-net/atc-coding-rules -# Version: 1.0.9 -# Updated: 01-02-2022 +# Version: 1.0.0 +# Updated: 25-09-2023 # Location: sample -# Distribution: DotNet6 +# Distribution: DotNet8 # Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options ########################################## diff --git a/src/.editorconfig b/src/.editorconfig index c2b78c6..970bed4 100644 --- a/src/.editorconfig +++ b/src/.editorconfig @@ -1,8 +1,8 @@ # ATC coding rules - https://github.com/atc-net/atc-coding-rules -# Version: 1.0.9 -# Updated: 01-02-2022 +# Version: 1.0.0 +# Updated: 25-09-2023 # Location: src -# Distribution: DotNet6 +# Distribution: DotNet8 # Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options ########################################## diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 30b2c30..409546d 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -53,7 +53,7 @@ - + diff --git a/test/.editorconfig b/test/.editorconfig index d51c7b5..cca1093 100644 --- a/test/.editorconfig +++ b/test/.editorconfig @@ -1,8 +1,8 @@ # ATC coding rules - https://github.com/atc-net/atc-coding-rules -# Version: 1.0.9 -# Updated: 01-02-2022 +# Version: 1.0.0 +# Updated: 25-09-2023 # Location: test -# Distribution: DotNet6 +# Distribution: DotNet8 # Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options ########################################## diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 492ab44..b8ec10d 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -11,8 +11,8 @@ - - + +