Skip to content

Commit 6c26b81

Browse files
author
Pan Shao
committed
update
1 parent a1c9993 commit 6c26b81

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/AZC0014Tests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation. All rights reserved.
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

44
using System.Threading.Tasks;
@@ -39,6 +39,8 @@ public class SomeClient
3939

4040

4141
[Theory]
42+
[InlineData("public void JsonModelWriteCore(Utf8JsonWriter writer) {}")]
43+
[InlineData("public void JsonModelCreateCore(ref Utf8JsonReader reader) {}")]
4244
[InlineData("internal class Class: System.IProgress<JsonElement> { public void Report (JsonElement value) {} }")]
4345
[InlineData("public void Report(string value) {}")]
4446
public async Task AZC0014NotProducedForNonPublicApisOrAllowedTypes(string usage)

src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/BannedAssembliesAnalyzer.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Generic;
22
using System.Collections.Immutable;
33
using System.Linq;
44
using Microsoft.CodeAnalysis;
@@ -38,7 +38,10 @@ static void CheckType(ISymbolAnalysisContext context, ITypeSymbol type, ISymbol
3838
{
3939
if (BannedAssemblies.Contains(type.ContainingAssembly.Name))
4040
{
41+
if (type.Name != "Utf8JsonReader" && type.Name != "Utf8JsonWriter")
42+
{
4143
context.ReportDiagnostic(Diagnostic.Create(Descriptors.AZC0014, symbol.Locations.First(), BannedAssembliesMessageArgs), symbol);
44+
}
4245
}
4346

4447
if (namedTypeSymbol.IsGenericType)

0 commit comments

Comments
 (0)