From d9bce297b1c1c1f2f49470bd4e1edaff9c49b47e Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 9 Apr 2024 13:13:09 +0200 Subject: [PATCH 01/10] feat: upgrade github action versions and dotnet version --- .github/workflows/post-integration.yml | 8 ++++---- .github/workflows/pre-integration.yml | 16 ++++++++-------- .github/workflows/release.yml | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/post-integration.yml b/.github/workflows/post-integration.yml index e4c8280..ac12261 100644 --- a/.github/workflows/post-integration.yml +++ b/.github/workflows/post-integration.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: ๐Ÿ›’ Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.PAT_WORKFLOWS }} @@ -30,10 +30,10 @@ jobs: with: setAllVars: true - - name: โš™๏ธ Setup dotnet 7.0.x - uses: actions/setup-dotnet@v1 + - name: โš™๏ธ Setup dotnet 8.0.x + uses: actions/setup-dotnet@v4 with: - dotnet-version: '7.0.x' + dotnet-version: '8.0.x' - name: โš™๏ธ Set up JDK 17 uses: actions/setup-java@v3 diff --git a/.github/workflows/pre-integration.yml b/.github/workflows/pre-integration.yml index f598991..2536549 100644 --- a/.github/workflows/pre-integration.yml +++ b/.github/workflows/pre-integration.yml @@ -15,14 +15,14 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: ๐Ÿ›’ Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: โš™๏ธ Setup dotnet 7.0.x - uses: actions/setup-dotnet@v1 + - name: โš™๏ธ Setup dotnet 8.0.x + uses: actions/setup-dotnet@v4 with: - dotnet-version: '7.0.x' + dotnet-version: '8.0.x' - name: ๐Ÿงน Clean run: dotnet clean -c Release && dotnet nuget locals all --clear @@ -39,14 +39,14 @@ jobs: - dotnet-build steps: - name: ๐Ÿ›’ Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: โš™๏ธ Setup dotnet 7.0.x - uses: actions/setup-dotnet@v1 + - name: โš™๏ธ Setup dotnet 8.0.x + uses: actions/setup-dotnet@v4 with: - dotnet-version: '7.0.x' + dotnet-version: '8.0.x' - name: ๐Ÿ” Restore packages run: dotnet restore diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 630d56b..a050a53 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: ๐Ÿ›’ Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.PAT_WORKFLOWS }} @@ -27,10 +27,10 @@ jobs: with: setAllVars: true - - name: โš™๏ธ Setup dotnet 7.0.x - uses: actions/setup-dotnet@v1 + - name: โš™๏ธ Setup dotnet 8.0.x + uses: actions/setup-dotnet@v4 with: - dotnet-version: '7.0.x' + dotnet-version: '8.0.x' - name: ๐Ÿงน Clean run: dotnet clean -c Release && dotnet nuget locals all --clear From 787d1dc29bf5ec9b5d56a34c663df2b80a439365 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 9 Apr 2024 13:13:33 +0200 Subject: [PATCH 02/10] fix: ensure proper cli command usage in atc-coding-rules-updater.ps1 --- atc-coding-rules-updater.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atc-coding-rules-updater.ps1 b/atc-coding-rules-updater.ps1 index df1a648..3d555a8 100644 --- a/atc-coding-rules-updater.ps1 +++ b/atc-coding-rules-updater.ps1 @@ -9,4 +9,4 @@ atc-coding-rules-updater ` run ` -p $currentPath ` --optionsPath $currentPath'\atc-coding-rules-updater.json' ` - -v \ No newline at end of file + --verbose \ No newline at end of file From 920eb06b30e4766bd954d0e0b078a9c2fb68c351 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 9 Apr 2024 13:13:55 +0200 Subject: [PATCH 03/10] feat: update atc-coding-rules-updater.json to dotnet 8 --- atc-coding-rules-updater.json | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/atc-coding-rules-updater.json b/atc-coding-rules-updater.json index f86f7f6..c0b63a2 100644 --- a/atc-coding-rules-updater.json +++ b/atc-coding-rules-updater.json @@ -1,8 +1,24 @@ { - "projectTarget": "DotNet6", - "mappings": { - "src": { "Paths": [ "src" ] }, - "test": { "Paths": [ "test" ] }, - "sample": { "Paths": [ "sample" ] } - } + "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 From a644d0a3c350000f308513286e320620bd43727d Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 9 Apr 2024 13:14:26 +0200 Subject: [PATCH 04/10] chore: run coding-rules-updater to get new .editorconfigs --- .editorconfig | 28 ++++++++++++++++++++++------ sample/.editorconfig | 6 +++--- src/.editorconfig | 6 +++--- test/.editorconfig | 9 +++++---- 4 files changed, 33 insertions(+), 16 deletions(-) diff --git a/.editorconfig b/.editorconfig index 33620b1..12256f8 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 @@ -195,8 +201,8 @@ csharp_style_unused_value_assignment_preference = discard_variable # Index and range preferences # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#index-and-range-preferences -csharp_style_prefer_index_operator = true # IDE0056 -csharp_style_prefer_range_operator = true # IDE0057 +csharp_style_prefer_index_operator = true:suggestion # IDE0056 +csharp_style_prefer_range_operator = true:suggestion # IDE0057 # Miscellaneous preferences # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#miscellaneous-preferences @@ -444,10 +450,12 @@ dotnet_naming_rule.parameters_rule.severity = warning dotnet_diagnostic.MA0003.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0003.md dotnet_diagnostic.MA0004.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0004.md dotnet_diagnostic.MA0006.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0006.md +dotnet_diagnostic.MA0011.severity = none # Duplicate of CA1305 dotnet_diagnostic.MA0016.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0016.md dotnet_diagnostic.MA0025.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0025.md dotnet_diagnostic.MA0026.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0026.md dotnet_diagnostic.MA0028.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0028.md +dotnet_diagnostic.MA0038.severity = none # Duplicate of CA1822 dotnet_diagnostic.MA0048.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0048.md @@ -455,8 +463,12 @@ dotnet_diagnostic.MA0048.severity = error # https://github.com/atc-net # https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ dotnet_diagnostic.CA1014.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1014.md dotnet_diagnostic.CA1068.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1068.md +dotnet_diagnostic.CA1305.severity = error dotnet_diagnostic.CA1707.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1707.md +dotnet_diagnostic.CA1812.severity = none +dotnet_diagnostic.CA1822.severity = suggestion 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 @@ -481,6 +493,7 @@ dotnet_diagnostic.SA1202.severity = none # https://github.com/atc-net dotnet_diagnostic.SA1204.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1204.md dotnet_diagnostic.SA1413.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1413.md dotnet_diagnostic.SA1600.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1600.md +dotnet_diagnostic.SA1601.severity = none dotnet_diagnostic.SA1602.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1602.md dotnet_diagnostic.SA1604.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1604.md dotnet_diagnostic.SA1623.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1623.md @@ -492,6 +505,10 @@ dotnet_diagnostic.SA1649.severity = error # https://github.com/atc-net # SonarAnalyzer.CSharp # https://rules.sonarsource.com/csharp dotnet_diagnostic.S1135.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/SonarAnalyzerCSharp/S1135.md +dotnet_diagnostic.S2629.severity = none # Don't use string interpolation in logging message templates. +dotnet_diagnostic.S6602.severity = none # "Find" method should be used instead of the "FirstOrDefault" +dotnet_diagnostic.S6603.severity = none # The collection-specific "TrueForAll" method should be used instead of the "All" +dotnet_diagnostic.S6605.severity = none # Collection-specific "Exists" method should be used instead of the "Any" ########################################## @@ -506,7 +523,6 @@ dotnet_diagnostic.S1135.severity = suggestion # https://github.com/atc-net dotnet_diagnostic.CA1003.severity = none # Change the event to replace the type 'System.Action?' with a generic EventHandler, for example EventHandler, where T is a valid EventArgs dotnet_diagnostic.CA1056.severity = none # URI properties should not be strings -dotnet_diagnostic.CA1812.severity = none # Internal class that is apparently never instantiated. dotnet_diagnostic.CA1859.severity = suggestion # Use concrete types when possible for improved performance dotnet_diagnostic.CA1860.severity = suggestion # Prefer comparing 'Count' to 0 rather than using 'Any()', both for clarity and for performance dotnet_diagnostic.CA1861.severity = suggestion # 'static readonly' fields over constant array arguments if the called method is called repeatedly and is not mutating the passed array diff --git a/sample/.editorconfig b/sample/.editorconfig index a711352..b9f125a 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/test/.editorconfig b/test/.editorconfig index c8c2951..d2db9c0 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 ########################################## @@ -27,6 +27,7 @@ dotnet_diagnostic.MA0016.severity = none # https://github.com/atc-net # Microsoft - Code Analysis # https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ dotnet_diagnostic.CA1068.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1068.md +dotnet_diagnostic.CA1602.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1602.md dotnet_diagnostic.CA1707.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1707.md dotnet_diagnostic.CA2007.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA2007.md @@ -53,4 +54,4 @@ dotnet_diagnostic.SA1133.severity = none # https://github.com/atc-net # Custom - Code Analyzers Rules ########################################## -dotnet_diagnostic.CA2201.severity = none # Do not raise reserved exception types +dotnet_diagnostic.CA2201.severity = none # Do not raise reserved exception types \ No newline at end of file From c221218f15226d1d5583408e485393c3ba11006d Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 9 Apr 2024 13:14:49 +0200 Subject: [PATCH 05/10] chore: upgrade projects to DotNet8 --- sample/Atc.Network.Console.Tcp/Atc.Network.Console.Tcp.csproj | 2 +- sample/Atc.Network.Console.Udp/Atc.Network.Console.Udp.csproj | 2 +- src/Atc.Network/Atc.Network.csproj | 2 +- test/Atc.Network.Test/Atc.Network.Test.csproj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sample/Atc.Network.Console.Tcp/Atc.Network.Console.Tcp.csproj b/sample/Atc.Network.Console.Tcp/Atc.Network.Console.Tcp.csproj index ac838f7..b793b8a 100644 --- a/sample/Atc.Network.Console.Tcp/Atc.Network.Console.Tcp.csproj +++ b/sample/Atc.Network.Console.Tcp/Atc.Network.Console.Tcp.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 Exe false $(NoWarn);CA1852 diff --git a/sample/Atc.Network.Console.Udp/Atc.Network.Console.Udp.csproj b/sample/Atc.Network.Console.Udp/Atc.Network.Console.Udp.csproj index fa92e3f..9dc8e0a 100644 --- a/sample/Atc.Network.Console.Udp/Atc.Network.Console.Udp.csproj +++ b/sample/Atc.Network.Console.Udp/Atc.Network.Console.Udp.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 Exe false $(NoWarn);CA1852 diff --git a/src/Atc.Network/Atc.Network.csproj b/src/Atc.Network/Atc.Network.csproj index fac9425..3fe8aea 100644 --- a/src/Atc.Network/Atc.Network.csproj +++ b/src/Atc.Network/Atc.Network.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 Atc.Network network Atc.Network is a collection of classes and clients for network communication. diff --git a/test/Atc.Network.Test/Atc.Network.Test.csproj b/test/Atc.Network.Test/Atc.Network.Test.csproj index 94c0ebf..a8c613f 100644 --- a/test/Atc.Network.Test/Atc.Network.Test.csproj +++ b/test/Atc.Network.Test/Atc.Network.Test.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable From b46126bd702076d2932a9807e586cfa0564d30e0 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 9 Apr 2024 13:15:16 +0200 Subject: [PATCH 06/10] chore: upgrade Nuget packages and analyzer versions --- Directory.Build.props | 4 ++-- .../Atc.Network.Console.Tcp.csproj | 2 +- .../Atc.Network.Console.Udp.csproj | 2 +- src/Atc.Network/Atc.Network.csproj | 5 +++-- test/Atc.Network.Test/Atc.Network.Test.csproj | 10 +++++----- test/Directory.Build.props | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 172a00a..f84b632 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -43,10 +43,10 @@ - + - + \ No newline at end of file diff --git a/sample/Atc.Network.Console.Tcp/Atc.Network.Console.Tcp.csproj b/sample/Atc.Network.Console.Tcp/Atc.Network.Console.Tcp.csproj index b793b8a..10d99bc 100644 --- a/sample/Atc.Network.Console.Tcp/Atc.Network.Console.Tcp.csproj +++ b/sample/Atc.Network.Console.Tcp/Atc.Network.Console.Tcp.csproj @@ -8,7 +8,7 @@ - + diff --git a/sample/Atc.Network.Console.Udp/Atc.Network.Console.Udp.csproj b/sample/Atc.Network.Console.Udp/Atc.Network.Console.Udp.csproj index 9dc8e0a..8a41d88 100644 --- a/sample/Atc.Network.Console.Udp/Atc.Network.Console.Udp.csproj +++ b/sample/Atc.Network.Console.Udp/Atc.Network.Console.Udp.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Atc.Network/Atc.Network.csproj b/src/Atc.Network/Atc.Network.csproj index 3fe8aea..987a4c2 100644 --- a/src/Atc.Network/Atc.Network.csproj +++ b/src/Atc.Network/Atc.Network.csproj @@ -13,8 +13,9 @@ - - + + + diff --git a/test/Atc.Network.Test/Atc.Network.Test.csproj b/test/Atc.Network.Test/Atc.Network.Test.csproj index a8c613f..89a1e91 100644 --- a/test/Atc.Network.Test/Atc.Network.Test.csproj +++ b/test/Atc.Network.Test/Atc.Network.Test.csproj @@ -9,15 +9,15 @@ - - + + - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/test/Directory.Build.props b/test/Directory.Build.props index d6c2c05..020fd5c 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -11,7 +11,7 @@ - + From a8a33d2b44f3c1f9ef5a93a7774a80d86d5c25c1 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 9 Apr 2024 13:15:32 +0200 Subject: [PATCH 07/10] chore: remove superfluous using in TcpClientExtensionsTests --- test/Atc.Network.Test/Extensions/TcpClientExtensionsTests.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/Atc.Network.Test/Extensions/TcpClientExtensionsTests.cs b/test/Atc.Network.Test/Extensions/TcpClientExtensionsTests.cs index 9041dd3..9627425 100644 --- a/test/Atc.Network.Test/Extensions/TcpClientExtensionsTests.cs +++ b/test/Atc.Network.Test/Extensions/TcpClientExtensionsTests.cs @@ -1,5 +1,3 @@ -using Microsoft.AspNetCore.Mvc; - namespace Atc.Network.Test.Extensions; [SuppressMessage("Blocker Bug", "S2930:\"IDisposables\" should be disposed", Justification = "OK.")] From a5ce048a4c1605f0aed572e3250dbdf905c98016 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 9 Apr 2024 13:15:47 +0200 Subject: [PATCH 08/10] fix: ensure tcpListener is correctly disposed in TcpServer --- src/Atc.Network/Tcp/TcpServer.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Atc.Network/Tcp/TcpServer.cs b/src/Atc.Network/Tcp/TcpServer.cs index 37514dc..e3aaa75 100644 --- a/src/Atc.Network/Tcp/TcpServer.cs +++ b/src/Atc.Network/Tcp/TcpServer.cs @@ -136,6 +136,7 @@ protected virtual void Dispose( } tcpListener?.Server.Dispose(); + tcpListener?.Dispose(); } /// From 451e60ce5aa9996b3301e1bb130839fccc7ba4a8 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 9 Apr 2024 13:16:01 +0200 Subject: [PATCH 09/10] chore: cleanup GlobalUsings --- sample/Atc.Network.Console.Tcp/GlobalUsings.cs | 2 -- sample/Atc.Network.Console.Udp/GlobalUsings.cs | 2 -- src/Atc.Network/GlobalUsings.cs | 3 --- test/Atc.Network.Test/GlobalUsings.cs | 3 --- 4 files changed, 10 deletions(-) diff --git a/sample/Atc.Network.Console.Tcp/GlobalUsings.cs b/sample/Atc.Network.Console.Tcp/GlobalUsings.cs index 5ea7f22..49dcece 100644 --- a/sample/Atc.Network.Console.Tcp/GlobalUsings.cs +++ b/sample/Atc.Network.Console.Tcp/GlobalUsings.cs @@ -1,6 +1,4 @@ global using System.Text; - global using Atc.Network; global using Atc.Network.Tcp; - global using Microsoft.Extensions.Logging; \ No newline at end of file diff --git a/sample/Atc.Network.Console.Udp/GlobalUsings.cs b/sample/Atc.Network.Console.Udp/GlobalUsings.cs index c393775..9e9b15f 100644 --- a/sample/Atc.Network.Console.Udp/GlobalUsings.cs +++ b/sample/Atc.Network.Console.Udp/GlobalUsings.cs @@ -1,6 +1,4 @@ global using System.Net; global using System.Text; - global using Atc.Network.Udp; - global using Microsoft.Extensions.Logging; \ No newline at end of file diff --git a/src/Atc.Network/GlobalUsings.cs b/src/Atc.Network/GlobalUsings.cs index 088d1a5..1fcdf72 100644 --- a/src/Atc.Network/GlobalUsings.cs +++ b/src/Atc.Network/GlobalUsings.cs @@ -2,7 +2,6 @@ global using System.ComponentModel.DataAnnotations; global using System.Diagnostics; global using System.Diagnostics.CodeAnalysis; - global using System.Net; global using System.Net.NetworkInformation; global using System.Net.Sockets; @@ -10,7 +9,6 @@ global using System.Text.Json; global using System.Text.Json.Serialization; global using System.Text.RegularExpressions; - global using Atc.Helpers; global using Atc.Network.Data; global using Atc.Network.Helpers; @@ -18,7 +16,6 @@ global using Atc.Network.Models; global using Atc.Network.Resource; global using Atc.Network.Tcp; - global using Microsoft.Extensions.Hosting; global using Microsoft.Extensions.Logging; global using Microsoft.Extensions.Logging.Abstractions; \ No newline at end of file diff --git a/test/Atc.Network.Test/GlobalUsings.cs b/test/Atc.Network.Test/GlobalUsings.cs index ad718f2..7b6f475 100644 --- a/test/Atc.Network.Test/GlobalUsings.cs +++ b/test/Atc.Network.Test/GlobalUsings.cs @@ -5,7 +5,6 @@ global using System.Net.NetworkInformation; global using System.Reflection; global using System.Text; - global using Atc.CodeDocumentation.Markdown; global using Atc.Network.Data; global using Atc.Network.Helpers; @@ -13,7 +12,5 @@ global using Atc.Network.Tcp; global using Atc.Network.Udp; global using Atc.XUnit; - global using Microsoft.Extensions.Logging.Abstractions; - global using Xunit.Abstractions; \ No newline at end of file From 4e67684460abb30ff18d5f91172e977616ab9562 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 9 Apr 2024 13:22:51 +0200 Subject: [PATCH 10/10] chore: bump LangVersion and TargetFramework in root Directory.Build.props --- Directory.Build.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index f84b632..3ee2efa 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -16,9 +16,9 @@ enable - 10.0 + 12.0 enable - net6.0 + net8.0 true 1573,1591,1712,CA1014,NU5104