From cb4bca9f5deafc5752c86c62fc829f802681108a Mon Sep 17 00:00:00 2001 From: GaelFraiteur Date: Thu, 12 Sep 2024 16:58:24 +0200 Subject: [PATCH] Fix. --- CodeQualityTalk.Verifier/Program.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CodeQualityTalk.Verifier/Program.cs b/CodeQualityTalk.Verifier/Program.cs index 90c9feb..04161fb 100644 --- a/CodeQualityTalk.Verifier/Program.cs +++ b/CodeQualityTalk.Verifier/Program.cs @@ -30,9 +30,13 @@ workspace.SourceCode.Types .Where(t => t.ContainingNamespace.FullName == "CodeQualityTalk.Abstractions") .SelectMany(t => t.GetOutboundReferences()) - .Where(r => r.DestinationDeclaration.GetNamespace()?.FullName == "CodeQualityTalk.Documents") + .Where(r => + { + var ns = r.DestinationDeclaration.GetNamespace()!.FullName; + return ns.StartsWith("CodeQualityTalk") && ns != "CodeQualityTalk.Abstractions"; + }) .Report(Severity.Warning, "MY003", - "The CodeQualityTalks.Abstractions namespace cannot use the CodeQualityTalk.Documents namespace."); + "The CodeQualityTalks.Abstractions namespace must only not have dependencies to other namespaces."); Console.WriteLine( $"{DiagnosticReporter.ReportedWarnings + DiagnosticReporter.ReportedErrors} architecture violations found.");