Skip to content

Commit 67850fe

Browse files
committed
Update packages to avoid build errors
1 parent a623193 commit 67850fe

File tree

4 files changed

+43
-2
lines changed

4 files changed

+43
-2
lines changed

StyleCop.Analyzers/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<PackageReference Include="AsyncUsageAnalyzers" Version="1.0.0-alpha003" PrivateAssets="all" />
4747
<PackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.46" PrivateAssets="all" />
4848
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.304" PrivateAssets="all" />
49-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.0" PrivateAssets="all" />
49+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.2" PrivateAssets="all" />
5050
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="3.8.0" PrivateAssets="all" />
5151
</ItemGroup>
5252

StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp10/DocumentationRules/SA1600CSharp10UnitTests.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,36 @@
33

44
namespace StyleCop.Analyzers.Test.CSharp10.DocumentationRules
55
{
6+
using Microsoft.CodeAnalysis.Testing;
67
using StyleCop.Analyzers.Test.CSharp9.DocumentationRules;
8+
using static StyleCop.Analyzers.Test.Verifiers.StyleCopCodeFixVerifier<
9+
StyleCop.Analyzers.DocumentationRules.SA1600ElementsMustBeDocumented,
10+
StyleCop.Analyzers.DocumentationRules.SA1600CodeFixProvider>;
711

812
public class SA1600CSharp10UnitTests : SA1600CSharp9UnitTests
913
{
14+
protected override DiagnosticResult[] GetExpectedResultTestRegressionMethodGlobalNamespace(string code)
15+
{
16+
if (code == "public void {|#0:TestMember|}() { }")
17+
{
18+
return new[]
19+
{
20+
// /0/Test0.cs(4,1): error CS0106: The modifier 'public' is not valid for this item
21+
DiagnosticResult.CompilerError("CS0106").WithSpan(4, 1, 4, 7).WithArguments("public"),
22+
23+
// /0/Test0.cs(4,1): error CS8320: Feature 'top-level statements' is not available in C# 7.2. Please use language version 9.0 or greater.
24+
DiagnosticResult.CompilerError("CS8320").WithSpan(4, 1, 4, 29).WithArguments("top-level statements", "9.0"),
25+
26+
// /0/Test0.cs(4,1): error CS8805: Program using top-level statements must be an executable.
27+
DiagnosticResult.CompilerError("CS8805").WithSpan(4, 1, 4, 29),
28+
};
29+
}
30+
31+
return new[]
32+
{
33+
DiagnosticResult.CompilerError("CS0116").WithMessage("A namespace cannot directly contain members such as fields, methods or statements").WithLocation(0),
34+
Diagnostic().WithLocation(0),
35+
};
36+
}
1037
}
1138
}

StyleCop.Analyzers/StyleCop.Analyzers.Test/Verifiers/GenericAnalyzerTest.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace StyleCop.Analyzers.Test.Verifiers
55
{
66
using System;
77
using System.Collections.Immutable;
8+
using System.IO;
89
using System.Threading;
910
using System.Threading.Tasks;
1011
using Microsoft.CodeAnalysis;
@@ -18,6 +19,8 @@ internal static class GenericAnalyzerTest
1819

1920
internal static readonly ReferenceAssemblies ReferenceAssembliesNet50;
2021

22+
internal static readonly ReferenceAssemblies ReferenceAssembliesNet60;
23+
2124
private static readonly Lazy<IExportProviderFactory> ExportProviderFactory;
2225

2326
static GenericAnalyzerTest()
@@ -28,6 +31,7 @@ static GenericAnalyzerTest()
2831
1 => "1.2.1",
2932
2 => "2.8.2",
3033
3 => "3.6.0",
34+
4 => "4.0.1",
3135
_ => throw new InvalidOperationException("Unknown version."),
3236
};
3337

@@ -38,6 +42,16 @@ static GenericAnalyzerTest()
3842
ReferenceAssembliesNet50 = ReferenceAssemblies.Net.Net50.AddPackages(ImmutableArray.Create(
3943
new PackageIdentity("Microsoft.CodeAnalysis.CSharp", codeAnalysisTestVersion)));
4044

45+
ReferenceAssembliesNet60 =
46+
new ReferenceAssemblies(
47+
"net6.0",
48+
new PackageIdentity(
49+
"Microsoft.NETCore.App.Ref",
50+
"6.0.0"),
51+
Path.Combine("ref", "net6.0"))
52+
.AddPackages(ImmutableArray.Create(
53+
new PackageIdentity("Microsoft.CodeAnalysis.CSharp", codeAnalysisTestVersion)));
54+
4155
ExportProviderFactory = new Lazy<IExportProviderFactory>(
4256
() =>
4357
{

StyleCop.Analyzers/StyleCop.Analyzers.Vsix/StyleCop.Analyzers.Vsix.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</PropertyGroup>
2929

3030
<ItemGroup>
31-
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="15.1.192" PrivateAssets="all" />
31+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="16.8.3038" PrivateAssets="all" />
3232
</ItemGroup>
3333

3434
<ItemGroup>

0 commit comments

Comments
 (0)