Skip to content

Commit 8ba15b3

Browse files
authored
Update Roslyn Analyzers (Azure#23793)
* Update Roslyn Analyzers Update Azure.ClientSdk.Analyzers and suppress newly-added AZC0016. Relates to Azure/azure-sdk-tools#1961 * Suppress or otherwise deal with AZC0016 violations * Fix typo * Fix CLU test build break from rename * Update public APIs for CLU
1 parent 7b7fdbe commit 8ba15b3

File tree

21 files changed

+77
-9
lines changed

21 files changed

+77
-9
lines changed

eng/Packages.Data.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@
134134

135135
<!--
136136
Build time packages
137-
All should have PrivateAssets="All" set so they don't become pacakge dependencies
137+
All should have PrivateAssets="All" set so they don't become package dependencies
138138
-->
139139
<ItemGroup>
140140
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20210915.2" PrivateAssets="All" />
141-
<PackageReference Update="Azure.ClientSdk.Analyzers" Version="0.1.1-dev.20210601.1" PrivateAssets="All" />
141+
<PackageReference Update="Azure.ClientSdk.Analyzers" Version="0.1.1-dev.20210903.4" PrivateAssets="All" />
142142
<PackageReference Update="coverlet.collector" Version="1.3.0" PrivateAssets="All" />
143143
<PackageReference Update="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.1" PrivateAssets="All" />
144144
<PackageReference Update="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.2" PrivateAssets="All" />

eng/service.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<PerfProjects Include="..\sdk\$(ServiceDirectory)\$(Project)\perf\**\*.csproj" />
2121
<StressProjects Include="..\sdk\$(ServiceDirectory)\$(Project)\stress\**\*.csproj" />
2222
<SampleApplications Include="..\samples\**\*.csproj" />
23-
<SrcProjects Include="..\sdk\$(ServiceDirectory)\$(Project)\*.csproj" Exclude="@(TestProjects);@(SamplesProjects)"/>
23+
<SrcProjects Include="..\sdk\$(ServiceDirectory)\$(Project)\src\**\*.csproj" />
2424
<ProjectReference Include="@(TestProjects)" Exclude="@(MgmtExcludePaths)" Condition="'$(IncludeTests)' == 'true'" />
2525
<ProjectReference Include="@(SamplesProjects)" Exclude="@(MgmtExcludePaths)" Condition="'$(IncludeSamples)' == 'true'" />
2626
<ProjectReference Include="@(PerfProjects)" Exclude="@(MgmtExcludePaths)" Condition="'$(IncludePerf)' == 'true'" />
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using System.Diagnostics.CodeAnalysis;
5+
6+
[assembly: SuppressMessage("Usage", "AZC0016:Invalid ServiceVersion member name.", Justification = "Generated code: https://github.com/Azure/autorest.csharp/issues/1524", Scope = "type", Target = "~T:Azure.Verticals.AgriFood.Farming.FarmBeatsClientOptions.ServiceVersion")]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using System.Diagnostics.CodeAnalysis;
5+
6+
[assembly: SuppressMessage("Usage", "AZC0016:Invalid ServiceVersion member name.", Justification = "Generated code: https://github.com/Azure/autorest.csharp/issues/1524", Scope = "type", Target = "~T:Azure.AI.AnomalyDetector.AnomalyDetectorClientOptions.ServiceVersion")]

sdk/cognitivelanguage/Azure.AI.Language.Conversations/api/Azure.AI.Language.Conversations.netstandard2.0.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ public ConversationAnalysisClient(System.Uri endpoint, Azure.AzureKeyCredential
2525
}
2626
public partial class ConversationAnalysisClientOptions : Azure.Core.ClientOptions
2727
{
28-
public ConversationAnalysisClientOptions(Azure.AI.Language.Conversations.ConversationAnalysisClientOptions.ServiceVersion version = Azure.AI.Language.Conversations.ConversationAnalysisClientOptions.ServiceVersion.V2021_07_15_preview) { }
28+
public ConversationAnalysisClientOptions(Azure.AI.Language.Conversations.ConversationAnalysisClientOptions.ServiceVersion version = Azure.AI.Language.Conversations.ConversationAnalysisClientOptions.ServiceVersion.V2021_07_15_Preview) { }
2929
public enum ServiceVersion
3030
{
31-
V2021_07_15_preview = 1,
31+
V2021_07_15_Preview = 1,
3232
}
3333
}
3434
}

sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/ConversationAnalysisClientOptions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Azure.AI.Language.Conversations
1111
/// </summary>
1212
public partial class ConversationAnalysisClientOptions : ClientOptions
1313
{
14-
private const ServiceVersion LatestVersion = ServiceVersion.V2021_07_15_preview;
14+
private const ServiceVersion LatestVersion = ServiceVersion.V2021_07_15_Preview;
1515

1616
/// <summary>
1717
/// The version of the service to use.
@@ -22,7 +22,7 @@ public enum ServiceVersion
2222
/// <summary>
2323
/// Service version "2021-07-15-preview".
2424
/// </summary>
25-
V2021_07_15_preview = 1,
25+
V2021_07_15_Preview = 1,
2626
#pragma warning restore CA1707 // Identifiers should not contain underscores
2727
}
2828

@@ -35,7 +35,7 @@ public ConversationAnalysisClientOptions(ServiceVersion version = LatestVersion)
3535
{
3636
Version = version switch
3737
{
38-
ServiceVersion.V2021_07_15_preview => "2021-07-15-preview",
38+
ServiceVersion.V2021_07_15_Preview => "2021-07-15-preview",
3939
_ => throw new NotSupportedException()
4040
};
4141

sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Infrastructure/ConversationAnalysisTestBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Azure.AI.Language.Conversations.Tests
99
/// Base class for live client tests using different service versions.
1010
/// </summary>
1111
/// <typeparam name="TClient">The type of client being tested.</typeparam>
12-
[ClientTestFixture(ConversationAnalysisClientOptions.ServiceVersion.V2021_07_15_preview)]
12+
[ClientTestFixture(ConversationAnalysisClientOptions.ServiceVersion.V2021_07_15_Preview)]
1313
public abstract class ConversationAnalysisTestBase<TClient> : RecordedTestBase<ConversationAnalysisTestEnvironment> where TClient : class
1414
{
1515
protected ConversationAnalysisTestBase(bool isAsync, ConversationAnalysisClientOptions.ServiceVersion serviceVersion, RecordedTestMode? mode)

sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/QuestionAnsweringClientOptions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ public enum ServiceVersion
2222
/// <summary>
2323
/// Service version "2021-05-01-preview".
2424
/// </summary>
25+
#pragma warning disable AZC0016 // Invalid ServiceVersion member name.
2526
V2021_05_01_preview = 1,
27+
#pragma warning restore AZC0016 // Invalid ServiceVersion member name.
2628
#pragma warning restore CA1707 // Identifiers should not contain underscores
2729
}
2830

sdk/communication/Azure.Communication.Identity/src/CommunicationIdentityClientOptions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ public enum ServiceVersion
4444
/// <summary>
4545
/// The V2021_03_31_preview1 of the identity service.
4646
/// </summary>
47+
#pragma warning disable AZC0016 // Invalid ServiceVersion member name.
4748
V2021_03_31_preview1 = 2,
49+
#pragma warning restore AZC0016 // Invalid ServiceVersion member name.
4850
#pragma warning restore CA1707 // Identifiers should not contain underscores
4951
}
5052
}

sdk/communication/Azure.Communication.NetworkTraversal/src/CommunicationRelayClientOptions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ public enum ServiceVersion
3939
/// <summary>
4040
/// The V2021_06_21_preview of the networking service.
4141
/// </summary>
42+
#pragma warning disable AZC0016 // Invalid ServiceVersion member name.
4243
V2021_06_21_preview = 1,
44+
#pragma warning restore AZC0016 // Invalid ServiceVersion member name.
4345
#pragma warning restore CA1707 // Identifiers should not contain underscores
4446
}
4547
}

0 commit comments

Comments
 (0)