From 0990b24e31c6dd5b20d6a1e5d3e7eedec9fbdf91 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 16:48:12 +0000 Subject: [PATCH 1/2] Bump SonarAnalyzer.CSharp from 10.29.0.143774 to 10.30.0.144632 --- updated-dependencies: - dependency-name: SonarAnalyzer.CSharp dependency-version: 10.30.0.144632 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 4aee092..633b2ea 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -20,7 +20,7 @@ - + From 0d93d1b0478367dba61a3b45959cbc96a991ac31 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 28 Jul 2026 19:43:56 +0200 Subject: [PATCH 2/2] fix(tests): drop redundant null-forgiving operators flagged by S8969 SonarAnalyzer.CSharp 10.30 adds S8969, which reports a null-forgiving operator the compiler already knows is unnecessary. FluentAssertions' NotBeNull() narrows the reference, so the following `!` is redundant and broke the build under TreatWarningsAsErrors. Co-Authored-By: Claude Opus 5 --- tests/ProjGraph.Tests.Integration.Mcp/McpTransportTests.cs | 2 +- .../AnalyzeFileUseCaseTests.cs | 2 +- .../ClassDiagramCoverageTests.cs | 6 +++--- .../SymbolResolverTests.cs | 2 +- .../EfDiscoveryCoverageTests.cs | 2 +- .../OwnedCrossFileTypeRegressionTests.cs | 2 +- .../OwnedRecordOwnerRegressionTests.cs | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/ProjGraph.Tests.Integration.Mcp/McpTransportTests.cs b/tests/ProjGraph.Tests.Integration.Mcp/McpTransportTests.cs index f8b5b3b..3d09859 100644 --- a/tests/ProjGraph.Tests.Integration.Mcp/McpTransportTests.cs +++ b/tests/ProjGraph.Tests.Integration.Mcp/McpTransportTests.cs @@ -51,7 +51,7 @@ private static string LocateServerExecutable() .FirstOrDefault(); serverExe.Should().NotBeNull($"the MCP server apphost must be present under {binRoot}"); - return serverExe!.FullName; + return serverExe.FullName; } private static string JoinText(CallToolResult result) diff --git a/tests/ProjGraph.Tests.Unit.ClassDiagram/AnalyzeFileUseCaseTests.cs b/tests/ProjGraph.Tests.Unit.ClassDiagram/AnalyzeFileUseCaseTests.cs index d94a490..612cf73 100644 --- a/tests/ProjGraph.Tests.Unit.ClassDiagram/AnalyzeFileUseCaseTests.cs +++ b/tests/ProjGraph.Tests.Unit.ClassDiagram/AnalyzeFileUseCaseTests.cs @@ -144,7 +144,7 @@ public class Widget { } await _sut.ExecuteAsync(filePath); captured.Should().NotBeNull(); - captured!.StartDirectory.Should().Be("/work/dir"); + captured.StartDirectory.Should().Be("/work/dir"); } private void SetupFileSystem(string filePath, string code) diff --git a/tests/ProjGraph.Tests.Unit.ClassDiagram/ClassDiagramCoverageTests.cs b/tests/ProjGraph.Tests.Unit.ClassDiagram/ClassDiagramCoverageTests.cs index ed12832..d4f4113 100644 --- a/tests/ProjGraph.Tests.Unit.ClassDiagram/ClassDiagramCoverageTests.cs +++ b/tests/ProjGraph.Tests.Unit.ClassDiagram/ClassDiagramCoverageTests.cs @@ -109,7 +109,7 @@ public async Task ResolveRelatedSymbol_DiscoveredFileAlreadyInCompilation_Should await _fileSystem.DidNotReceive().ReadAllTextAsync(Arg.Any(), Arg.Any()); // The reused tree does not actually declare Ghost, so the original symbol is handed back. resolved.Should().NotBeNull(); - resolved!.Name.Should().Be("Ghost"); + resolved.Name.Should().Be("Ghost"); } [Fact] @@ -130,7 +130,7 @@ public async Task ResolveRelatedSymbol_DiscoveredFileWithoutMatchingDeclaration_ var resolved = await sut.ResolveRelatedSymbolAsync(ghost, context); resolved.Should().NotBeNull(); - resolved!.Name.Should().Be("Ghost"); + resolved.Name.Should().Be("Ghost"); } [Fact] @@ -149,7 +149,7 @@ public async Task ResolveRelatedSymbol_DiscoveredFileDeclaringTheType_ShouldReso var resolved = await sut.ResolveRelatedSymbolAsync(ghost, context); resolved.Should().NotBeNull(); - resolved!.Name.Should().Be("Ghost"); + resolved.Name.Should().Be("Ghost"); resolved.TypeKind.Should().Be(Microsoft.CodeAnalysis.TypeKind.Class); } diff --git a/tests/ProjGraph.Tests.Unit.ClassDiagram/SymbolResolverTests.cs b/tests/ProjGraph.Tests.Unit.ClassDiagram/SymbolResolverTests.cs index 672afea..b49c79b 100644 --- a/tests/ProjGraph.Tests.Unit.ClassDiagram/SymbolResolverTests.cs +++ b/tests/ProjGraph.Tests.Unit.ClassDiagram/SymbolResolverTests.cs @@ -47,7 +47,7 @@ public async Task ResolveRelatedSymbolAsync_SymbolDeclaredInCompilation_ShouldNo var resolved = await sut.ResolveRelatedSymbolAsync(baseSymbol, context); resolved.Should().NotBeNull(); - resolved!.Name.Should().Be("Base"); + resolved.Name.Should().Be("Base"); await _discovery.DidNotReceive().FindTypeDefinitionFileAsync(Arg.Any(), Arg.Any()); } diff --git a/tests/ProjGraph.Tests.Unit.EntityFramework/EfDiscoveryCoverageTests.cs b/tests/ProjGraph.Tests.Unit.EntityFramework/EfDiscoveryCoverageTests.cs index d03cd6a..ad087ef 100644 --- a/tests/ProjGraph.Tests.Unit.EntityFramework/EfDiscoveryCoverageTests.cs +++ b/tests/ProjGraph.Tests.Unit.EntityFramework/EfDiscoveryCoverageTests.cs @@ -248,7 +248,7 @@ public class Address var owned = model.Entities.SingleOrDefault(e => e.Key == "Customer.Addresses"); owned.Should().NotBeNull("OwnsMany over an array navigation must still capture the owned type"); - owned!.IsCollection.Should().BeTrue(); + owned.IsCollection.Should().BeTrue(); owned.Properties.Select(p => p.Name).Should().Contain("Street").And.Contain("City"); } diff --git a/tests/ProjGraph.Tests.Unit.EntityFramework/OwnedCrossFileTypeRegressionTests.cs b/tests/ProjGraph.Tests.Unit.EntityFramework/OwnedCrossFileTypeRegressionTests.cs index 5e70aad..0988668 100644 --- a/tests/ProjGraph.Tests.Unit.EntityFramework/OwnedCrossFileTypeRegressionTests.cs +++ b/tests/ProjGraph.Tests.Unit.EntityFramework/OwnedCrossFileTypeRegressionTests.cs @@ -83,7 +83,7 @@ public record Money(decimal Amount, string Currency = "USD"); var owned = model.Entities.SingleOrDefault(e => e.Key == "Product.Price"); owned.Should().NotBeNull( "OwnsOne(p => p.Price) must capture the owned entity even though Money.cs is a separate file"); - owned!.Properties.Select(p => p.Name).Should().BeEquivalentTo(["Amount", "Currency"], + owned.Properties.Select(p => p.Name).Should().BeEquivalentTo(["Amount", "Currency"], "Money's columns can only come from CLR seeding — there is no Property() call for either — " + "so this fails unless Money.cs was pulled into the compilation and resolved"); diff --git a/tests/ProjGraph.Tests.Unit.EntityFramework/OwnedRecordOwnerRegressionTests.cs b/tests/ProjGraph.Tests.Unit.EntityFramework/OwnedRecordOwnerRegressionTests.cs index f0f9ee3..0e6b67a 100644 --- a/tests/ProjGraph.Tests.Unit.EntityFramework/OwnedRecordOwnerRegressionTests.cs +++ b/tests/ProjGraph.Tests.Unit.EntityFramework/OwnedRecordOwnerRegressionTests.cs @@ -87,7 +87,7 @@ public class Money owned.Should().NotBeNull( "OwnsOne(p => p.Price) must capture the owned entity even though Product is record-declared " + "and Money.cs is a separate file"); - owned!.Properties.Select(p => p.Name).Should().BeEquivalentTo(["Amount", "Currency"], + owned.Properties.Select(p => p.Name).Should().BeEquivalentTo(["Amount", "Currency"], "the pre-pass must find Price on the record-declared Product to discover Money.cs and pull it " + "into the compilation; without that, Money resolves to an error type and the entity is captured " + "with zero properties"); @@ -140,7 +140,7 @@ public record Money(decimal Amount, string Currency); owned.Should().NotBeNull( "OwnsOne(p => p.Price) must capture the owned entity even though Price is declared as a " + "primary-constructor parameter rather than a property member"); - owned!.Properties.Select(p => p.Name).Should().BeEquivalentTo(["Amount", "Currency"], + owned.Properties.Select(p => p.Name).Should().BeEquivalentTo(["Amount", "Currency"], "the pre-pass must find the Price parameter on the positional record to discover Money.cs; " + "without that, Money resolves to an error type and the owned entity renders as an empty box");