From e3125d1c18d96677cdb7f16ca4858ff19271d197 Mon Sep 17 00:00:00 2001 From: Anne Thompson Date: Wed, 9 Aug 2023 09:59:37 -0700 Subject: [PATCH] Allow use of shared source in Azure.Core --- .../Azure.ClientSdk.Analyzers/BannedTypesAnalyzer.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/BannedTypesAnalyzer.cs b/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/BannedTypesAnalyzer.cs index 64185d16da9..03780260b5c 100644 --- a/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/BannedTypesAnalyzer.cs +++ b/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/BannedTypesAnalyzer.cs @@ -51,6 +51,11 @@ static void CheckType(ISymbolAnalysisContext context, ITypeSymbol type, ISymbol } } + if (IsAzureCore(context.Symbol.ContainingAssembly)) + { + return; + } + switch (context.Symbol) { case IParameterSymbol parameterSymbol: @@ -77,5 +82,10 @@ static void CheckType(ISymbolAnalysisContext context, ITypeSymbol type, ISymbol break; } } + + private bool IsAzureCore(IAssemblySymbol assembly) + { + return assembly.Name.Equals("Azure.Core"); + } } }