From c33d4e46658f8994aab680eede55c044922a15c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20H=C3=BCbner?= Date: Tue, 31 Jan 2023 06:05:24 +0100 Subject: [PATCH 1/4] tech: update dependencies --- ...HierarchyDiagnosticSuppressor.Tests.csproj | 6 ++-- ...edTypeHierarchyDiagnosticSuppressor.csproj | 32 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ClosedTypeHierarchyDiagnosticSuppressor.Tests/ClosedTypeHierarchyDiagnosticSuppressor.Tests.csproj b/ClosedTypeHierarchyDiagnosticSuppressor.Tests/ClosedTypeHierarchyDiagnosticSuppressor.Tests.csproj index ac2ffcf..0677103 100644 --- a/ClosedTypeHierarchyDiagnosticSuppressor.Tests/ClosedTypeHierarchyDiagnosticSuppressor.Tests.csproj +++ b/ClosedTypeHierarchyDiagnosticSuppressor.Tests/ClosedTypeHierarchyDiagnosticSuppressor.Tests.csproj @@ -8,10 +8,10 @@ - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/ClosedTypeHierarchyDiagnosticSuppressor/ClosedTypeHierarchyDiagnosticSuppressor.csproj b/ClosedTypeHierarchyDiagnosticSuppressor/ClosedTypeHierarchyDiagnosticSuppressor.csproj index 819f8c8..bcd2773 100644 --- a/ClosedTypeHierarchyDiagnosticSuppressor/ClosedTypeHierarchyDiagnosticSuppressor.csproj +++ b/ClosedTypeHierarchyDiagnosticSuppressor/ClosedTypeHierarchyDiagnosticSuppressor.csproj @@ -2,15 +2,15 @@ netstandard2.0 - true - 10 - enable - - SvSoft.Analyzers.ClosedTypeHierarchyDiagnosticSuppression - <__CurrentYear>$([System.DateTime]::Now.Year) - Copyright (C) Sven Hübner 2022 - $(__CurrentYear) - Sven Hübner - SvSoft.Analyzers.ClosedTypeHierarchyDiagnosticSuppression + true + 10 + enable + + SvSoft.Analyzers.ClosedTypeHierarchyDiagnosticSuppression + <__CurrentYear>$([System.DateTime]::Now.Year) + Copyright (C) Sven Hübner 2022 - $(__CurrentYear) + Sven Hübner + SvSoft.Analyzers.ClosedTypeHierarchyDiagnosticSuppression discriminated unions, match, switch true https://github.com/shuebner/ClosedTypeHierarchyDiagnosticSuppressor @@ -19,21 +19,21 @@ - + - - + + - false - true + false + true - + - + From 8cb71c64354a7cf96bb8ff12f8b7ca7679655042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20H=C3=BCbner?= Date: Tue, 31 Jan 2023 06:05:52 +0100 Subject: [PATCH 2/4] tech: make CSharp.Workspaces a compile-time dependency --- .../ClosedTypeHierarchyDiagnosticSuppressor.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ClosedTypeHierarchyDiagnosticSuppressor/ClosedTypeHierarchyDiagnosticSuppressor.csproj b/ClosedTypeHierarchyDiagnosticSuppressor/ClosedTypeHierarchyDiagnosticSuppressor.csproj index bcd2773..d73e933 100644 --- a/ClosedTypeHierarchyDiagnosticSuppressor/ClosedTypeHierarchyDiagnosticSuppressor.csproj +++ b/ClosedTypeHierarchyDiagnosticSuppressor/ClosedTypeHierarchyDiagnosticSuppressor.csproj @@ -23,7 +23,7 @@ - + From e62409ae8f8bc1020371a57bdedeb0f007bb87a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20H=C3=BCbner?= Date: Tue, 31 Jan 2023 06:09:48 +0100 Subject: [PATCH 3/4] tech: suppress FP analyzer warning --- ClosedTypeHierarchyDiagnosticSuppressor/TypeHierarchyHelper.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ClosedTypeHierarchyDiagnosticSuppressor/TypeHierarchyHelper.cs b/ClosedTypeHierarchyDiagnosticSuppressor/TypeHierarchyHelper.cs index e9c524a..eeed6cb 100644 --- a/ClosedTypeHierarchyDiagnosticSuppressor/TypeHierarchyHelper.cs +++ b/ClosedTypeHierarchyDiagnosticSuppressor/TypeHierarchyHelper.cs @@ -65,7 +65,9 @@ static bool HasOnlyPrivateConstructorsAndProtectedCopyCtors(INamedTypeSymbol roo (IsRecord(rootCandidate) && rootCandidate.Constructors.All(c => c.DeclaredAccessibility == Accessibility.Private || MatchesImplicitlyCreatedRecordCopyCtor(rootCandidate, c))); +#pragma warning disable CS0162 // Unreachable code detected, FP, see https://github.com/dotnet/roslyn/issues/41429 const string CompilerCreatedCloneMethodNameOnRecordTypes = "$"; +#pragma warning restore CS0162 // Unreachable code detected static bool IsRecord(INamedTypeSymbol recordCandidate) => recordCandidate.MemberNames.Contains(CompilerCreatedCloneMethodNameOnRecordTypes); From 070b0ea84181c992a3197d012fc60127c58426e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20H=C3=BCbner?= Date: Tue, 31 Jan 2023 06:25:58 +0100 Subject: [PATCH 4/4] tech: use latest SDK --- ClosedTypeHierarchyDiagnosticSuppressor.sln | 3 ++- global.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ClosedTypeHierarchyDiagnosticSuppressor.sln b/ClosedTypeHierarchyDiagnosticSuppressor.sln index 083717e..c2b3a55 100644 --- a/ClosedTypeHierarchyDiagnosticSuppressor.sln +++ b/ClosedTypeHierarchyDiagnosticSuppressor.sln @@ -8,9 +8,10 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{60F51DB5-2BCC-4800-93D2-6B8604FD2DDF}" ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig + global.json = global.json EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClosedTypeHierarchyDiagnosticSuppressor.Tests", "ClosedTypeHierarchyDiagnosticSuppressor.Tests\ClosedTypeHierarchyDiagnosticSuppressor.Tests.csproj", "{86A9C76C-96A2-4085-BCDF-C92E2CE4019B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClosedTypeHierarchyDiagnosticSuppressor.Tests", "ClosedTypeHierarchyDiagnosticSuppressor.Tests\ClosedTypeHierarchyDiagnosticSuppressor.Tests.csproj", "{86A9C76C-96A2-4085-BCDF-C92E2CE4019B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/global.json b/global.json index 37c124f..9068438 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "6.0.300" + "version": "6.0.405" } } \ No newline at end of file