Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
meziantou committed Nov 25, 2023
1 parent e1e8e37 commit fde3d21
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 41 deletions.
14 changes: 7 additions & 7 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
<When Condition="$(RoslynVersion) == 'roslyn4.8'">
<ItemGroup>
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="4.8.0-3.final" />
<PackageReference Update="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.8.0-3.final" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0-3.final" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
<PackageReference Update="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.8.0" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" />
</ItemGroup>
<PropertyGroup>
<DefineConstants>$(DefineConstants);ROSLYN_4_8;ROSLYN_4_2_OR_GREATER;ROSLYN_4_4_OR_GREATER;ROSLYN_4_6_OR_GREATER;ROSLYN_4_8_OR_GREATER</DefineConstants>
Expand All @@ -79,12 +79,12 @@
<Otherwise>
<ItemGroup>
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0-beta1.23472.1" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="4.8.0-3.final" />
<PackageReference Update="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.8.0-3.final" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0-3.final" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
<PackageReference Update="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.8.0" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" />
</ItemGroup>
<PropertyGroup>
<DefineConstants>$(DefineConstants);ROSLYN4_4;ROSLYN_4_2_OR_GREATER;ROSLYN_4_4_OR_GREATER;ROSLYN_4_5_OR_GREATER;ROSLYN_4_6_OR_GREATER;ROSLYN_4_8_OR_GREATER</DefineConstants>
<DefineConstants>$(DefineConstants);ROSLYN4_8;ROSLYN_4_2_OR_GREATER;ROSLYN_4_4_OR_GREATER;ROSLYN_4_5_OR_GREATER;ROSLYN_4_6_OR_GREATER;ROSLYN_4_8_OR_GREATER</DefineConstants>
<DefineConstants>$(DefineConstants);CSHARP9_OR_GREATER;CSHARP10_OR_GREATER;CSHARP11_OR_GREATER;CSHARP12_OR_GREATER</DefineConstants>
<NoWarn>$(NoWarn);CS0618</NoWarn>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ListDotNetTypes/ListDotNetTypes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NuGet.Protocol" Version="6.7.0" />
<PackageReference Include="NuGet.Protocol" Version="6.8.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<IncludeAssets>analyzers</IncludeAssets>
</PackageReference>

<PackageReference Include="Meziantou.Analyzer" Version="2.0.83" Condition="'$(PackageId)' != 'Meziantou.Analyzer'">
<PackageReference Include="Meziantou.Analyzer" Version="2.0.111" Condition="'$(PackageId)' != 'Meziantou.Analyzer'">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>analyzers</IncludeAssets>
</PackageReference>
Expand Down
6 changes: 3 additions & 3 deletions src/Meziantou.Analyzer/Meziantou.Analyzer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" />

<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>analyzers</IncludeAssets>
</PackageReference>

<PackageReference Include="Meziantou.Analyzer" Version="2.0.109" Condition="'$(PackageId)' != 'Meziantou.Analyzer'">
<PackageReference Include="Meziantou.Analyzer" Version="2.0.111" Condition="'$(PackageId)' != 'Meziantou.Analyzer'">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>analyzers</IncludeAssets>
</PackageReference>

<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0-2.final" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
41 changes: 16 additions & 25 deletions tests/Meziantou.Analyzer.Test/Helpers/ProjectBuilder.Validation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ public async Task ValidateAsync()
{
if (DiagnosticAnalyzer == null)
{
Assert.True(false, "DiagnosticAnalyzer is not configured");
Assert.Fail("DiagnosticAnalyzer is not configured");
}

if (ExpectedFixedCode != null && CodeFixProvider == null)
{
Assert.True(false, "CodeFixProvider is not configured");
Assert.Fail("CodeFixProvider is not configured");
}

if (ExpectedDiagnosticResults == null)
{
Assert.True(false, "ExpectedDiagnostic is not configured");
Assert.Fail("ExpectedDiagnostic is not configured");
}

await VerifyDiagnostic(ExpectedDiagnosticResults).ConfigureAwait(false);
Expand Down Expand Up @@ -76,7 +76,7 @@ private void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResults, ILis
{
var diagnosticsOutput = actualResults.Any() ? FormatDiagnostics(analyzers, actualResults.ToArray()) : " NONE.";

Assert.True(false, $"Mismatch between number of diagnostics returned, expected \"{expectedCount}\" actual \"{actualCount}\"\r\n\r\nDiagnostics:\r\n{diagnosticsOutput}\r\n");
Assert.Fail($"Mismatch between number of diagnostics returned, expected \"{expectedCount}\" actual \"{actualCount}\"\r\n\r\nDiagnostics:\r\n{diagnosticsOutput}\r\n");
}

for (var i = 0; i < expectedResults.Count; i++)
Expand All @@ -88,8 +88,7 @@ private void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResults, ILis
{
if (actual.Location != Location.None)
{
Assert.True(false,
string.Format(CultureInfo.InvariantCulture, "Expected:\nA project diagnostic with No location\nActual:\n{0}",
Assert.Fail(string.Format(CultureInfo.InvariantCulture, "Expected:\nA project diagnostic with No location\nActual:\n{0}",
FormatDiagnostics(analyzers, actual)));
}
}
Expand All @@ -100,8 +99,7 @@ private void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResults, ILis

if (additionalLocations.Length != expected.Locations.Count - 1)
{
Assert.True(false,
string.Format(CultureInfo.InvariantCulture,
Assert.Fail(string.Format(CultureInfo.InvariantCulture,
"Expected {0} additional locations but got {1} for Diagnostic:\r\n {2}\r\n",
expected.Locations.Count - 1, additionalLocations.Length,
FormatDiagnostics(analyzers, actual)));
Expand All @@ -115,22 +113,19 @@ private void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResults, ILis

if (expected.Id != null && !string.Equals(actual.Id, expected.Id, StringComparison.Ordinal))
{
Assert.True(false,
string.Format(CultureInfo.InvariantCulture, "Expected diagnostic id to be \"{0}\" was \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
Assert.Fail(string.Format(CultureInfo.InvariantCulture, "Expected diagnostic id to be \"{0}\" was \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
expected.Id, actual.Id, FormatDiagnostics(analyzers, actual)));
}

if (expected.Severity != null && actual.Severity != expected.Severity)
{
Assert.True(false,
string.Format(CultureInfo.InvariantCulture, "Expected diagnostic severity to be \"{0}\" was \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
Assert.Fail(string.Format(CultureInfo.InvariantCulture, "Expected diagnostic severity to be \"{0}\" was \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
expected.Severity, actual.Severity, FormatDiagnostics(analyzers, actual)));
}

if (expected.Message != null && !string.Equals(actual.GetMessage(CultureInfo.InvariantCulture), expected.Message, StringComparison.Ordinal))
{
Assert.True(false,
string.Format(CultureInfo.InvariantCulture, "Expected diagnostic message to be \"{0}\" was \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
Assert.Fail(string.Format(CultureInfo.InvariantCulture, "Expected diagnostic message to be \"{0}\" was \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
expected.Message, actual.GetMessage(CultureInfo.InvariantCulture), FormatDiagnostics(analyzers, actual)));
}
}
Expand Down Expand Up @@ -297,7 +292,7 @@ private async Task<Diagnostic[]> GetSortedDiagnosticsFromDocuments(IList<Diagnos
sourceCode = (await document.GetSyntaxRootAsync().ConfigureAwait(false)).ToFullString();
}

Assert.True(false, "The code doesn't compile. " + string.Join(Environment.NewLine, result.Diagnostics.Where(d => d.Severity == DiagnosticSeverity.Error)) + Environment.NewLine + sourceCode);
Assert.Fail("The code doesn't compile. " + string.Join(Environment.NewLine, result.Diagnostics.Where(d => d.Severity == DiagnosticSeverity.Error)) + Environment.NewLine + sourceCode);
}
}

Expand Down Expand Up @@ -423,8 +418,7 @@ private static void VerifyDiagnosticLocation(IList<DiagnosticAnalyzer> analyzers
{
if (actualLinePosition.Line + 1 != expected.LineStart)
{
Assert.True(false,
string.Format(CultureInfo.InvariantCulture, "Expected diagnostic to be on line \"{0}\" was actually on line \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
Assert.Fail(string.Format(CultureInfo.InvariantCulture, "Expected diagnostic to be on line \"{0}\" was actually on line \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
expected.LineStart, actualLinePosition.Line + 1, FormatDiagnostics(analyzers, diagnostic)));
}
}
Expand All @@ -434,8 +428,7 @@ private static void VerifyDiagnosticLocation(IList<DiagnosticAnalyzer> analyzers
{
if (actualLinePosition.Character + 1 != expected.ColumnStart)
{
Assert.True(false,
string.Format(CultureInfo.InvariantCulture, "Expected diagnostic to start at column \"{0}\" was actually at column \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
Assert.Fail(string.Format(CultureInfo.InvariantCulture, "Expected diagnostic to start at column \"{0}\" was actually at column \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
expected.ColumnStart, actualLinePosition.Character + 1, FormatDiagnostics(analyzers, diagnostic)));
}
}
Expand All @@ -449,8 +442,7 @@ private static void VerifyDiagnosticLocation(IList<DiagnosticAnalyzer> analyzers
{
if (actualLinePosition.Line + 1 != expected.LineEnd)
{
Assert.True(false,
string.Format(CultureInfo.InvariantCulture, "Expected diagnostic to end on line \"{0}\" was actually on line \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
Assert.Fail(string.Format(CultureInfo.InvariantCulture, "Expected diagnostic to end on line \"{0}\" was actually on line \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
expected.LineStart, actualLinePosition.Line + 1, FormatDiagnostics(analyzers, diagnostic)));
}
}
Expand All @@ -460,8 +452,7 @@ private static void VerifyDiagnosticLocation(IList<DiagnosticAnalyzer> analyzers
{
if (actualLinePosition.Character + 1 != expected.ColumnEnd)
{
Assert.True(false,
string.Format(CultureInfo.InvariantCulture, "Expected diagnostic to end at column \"{0}\" was actually at column \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
Assert.Fail(string.Format(CultureInfo.InvariantCulture, "Expected diagnostic to end at column \"{0}\" was actually at column \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
expected.ColumnStart, actualLinePosition.Character + 1, FormatDiagnostics(analyzers, diagnostic)));
}
}
Expand All @@ -486,7 +477,7 @@ private async Task VerifyFix(IList<DiagnosticAnalyzer> analyzers, CodeFixProvide
{
if (!codeFixProvider.FixableDiagnosticIds.Any(id => string.Equals(diagnostic.Id, id, StringComparison.Ordinal)))
{
Assert.True(false, $"The CodeFixProvider is not valid for the DiagnosticAnalyzer. DiagnosticId: {diagnostic.Id}, Supported diagnostics: {string.Join(",", codeFixProvider.FixableDiagnosticIds)}");
Assert.Fail($"The CodeFixProvider is not valid for the DiagnosticAnalyzer. DiagnosticId: {diagnostic.Id}, Supported diagnostics: {string.Join(",", codeFixProvider.FixableDiagnosticIds)}");
}
}

Expand Down Expand Up @@ -557,7 +548,7 @@ private async Task<Document> ApplyFix(Document document, CodeAction codeAction,
sourceCode = (await document.GetSyntaxRootAsync().ConfigureAwait(false)).ToFullString();
}

Assert.True(false, "The fixed code doesn't compile. " + string.Join(Environment.NewLine, result.Diagnostics.Where(d => d.Severity == DiagnosticSeverity.Error)) + Environment.NewLine + sourceCode);
Assert.Fail("The fixed code doesn't compile. " + string.Join(Environment.NewLine, result.Diagnostics.Where(d => d.Severity == DiagnosticSeverity.Error)) + Environment.NewLine + sourceCode);
}
}

Expand Down
8 changes: 4 additions & 4 deletions tests/Meziantou.Analyzer.Test/Meziantou.Analyzer.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="System.Reflection.Metadata" Version="7.0.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="System.Reflection.Metadata" Version="8.0.0" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit fde3d21

Please sign in to comment.