diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 071a75b..43c5914 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,10 +21,6 @@ jobs: - name: Setup .NET SDK uses: actions/setup-dotnet@v2 - with: - dotnet-version: | - 5.0.301 - 6.0.101 - name: Setup Node.js uses: actions/setup-node@v3 @@ -80,10 +76,6 @@ jobs: - name: Setup .NET SDK uses: actions/setup-dotnet@v2 - with: - dotnet-version: | - 5.0.301 - 6.0.101 - name: Integration Tests shell: bash diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index d15f3cf..ffa42e8 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -43,10 +43,6 @@ jobs: - name: Setup .NET SDK uses: actions/setup-dotnet@v2 - with: - dotnet-version: | - 5.0.301 - 6.0.101 - name: Build shell: bash @@ -70,10 +66,6 @@ jobs: - name: Setup .NET SDK uses: actions/setup-dotnet@v2 - with: - dotnet-version: | - 5.0.301 - 6.0.101 - name: Setup Node.js uses: actions/setup-node@v3 @@ -115,10 +107,6 @@ jobs: - name: Setup .NET SDK uses: actions/setup-dotnet@v2 - with: - dotnet-version: | - 5.0.301 - 6.0.101 - name: Publish shell: bash diff --git a/docs/global.json b/docs/global.json index 6ecdd61..49d2255 100644 --- a/docs/global.json +++ b/docs/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.101", + "version": "6.0.300", "rollForward": "latestFeature" } } diff --git a/examples/Cli/Injection/Injection.csproj b/examples/Cli/Injection/Injection.csproj index 18f5702..9d9db39 100644 --- a/examples/Cli/Injection/Injection.csproj +++ b/examples/Cli/Injection/Injection.csproj @@ -11,7 +11,7 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.8" /> + <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" /> </ItemGroup> <ItemGroup> diff --git a/examples/Cli/Logging/Logging.csproj b/examples/Cli/Logging/Logging.csproj index e54e1d7..e7c4cd0 100644 --- a/examples/Cli/Logging/Logging.csproj +++ b/examples/Cli/Logging/Logging.csproj @@ -12,10 +12,10 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" /> - <PackageReference Include="Serilog" Version="2.10.0" /> - <PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" /> - <PackageReference Include="Serilog.Sinks.File" Version="4.1.0" /> + <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" /> + <PackageReference Include="Serilog" Version="2.11.0" /> + <PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" /> + <PackageReference Include="Serilog.Sinks.File" Version="5.0.0" /> <PackageReference Include="Serilog.Sinks.Map" Version="1.0.2" /> </ItemGroup> diff --git a/examples/Console/Progress/Progress.csproj b/examples/Console/Progress/Progress.csproj index a5942b5..06a9a28 100644 --- a/examples/Console/Progress/Progress.csproj +++ b/examples/Console/Progress/Progress.csproj @@ -9,7 +9,7 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> + <PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> </ItemGroup> <ItemGroup> diff --git a/examples/Console/Status/Status.csproj b/examples/Console/Status/Status.csproj index 55db6c9..96a7472 100644 --- a/examples/Console/Status/Status.csproj +++ b/examples/Console/Status/Status.csproj @@ -9,7 +9,7 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> + <PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> </ItemGroup> <ItemGroup> diff --git a/global.json b/global.json index 6a1b5ce..d00cb91 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "projects": [ "src", "tests" ], "sdk": { - "version": "6.0.101", + "version": "6.0.300", "rollForward": "latestFeature" } } diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 114901b..64057c4 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -32,12 +32,12 @@ </PropertyGroup> <ItemGroup Label="Package References"> - <PackageReference Include="MinVer" PrivateAssets="All" Version="2.5.0" /> + <PackageReference Include="MinVer" PrivateAssets="All" Version="4.1.0" /> <PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" Version="1.1.1" /> - <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.312"> + <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435"> <PrivateAssets>All</PrivateAssets> </PackageReference> - <PackageReference Include="Roslynator.Analyzers" Version="3.3.0"> + <PackageReference Include="Roslynator.Analyzers" Version="4.1.1"> <PrivateAssets>All</PrivateAssets> </PackageReference> </ItemGroup> diff --git a/src/Spectre.Console.Analyzer.Sandbox/Spectre.Console.Analyzer.Sandbox.csproj b/src/Spectre.Console.Analyzer.Sandbox/Spectre.Console.Analyzer.Sandbox.csproj index a6c93fd..3f799ca 100644 --- a/src/Spectre.Console.Analyzer.Sandbox/Spectre.Console.Analyzer.Sandbox.csproj +++ b/src/Spectre.Console.Analyzer.Sandbox/Spectre.Console.Analyzer.Sandbox.csproj @@ -1,8 +1,8 @@ -<Project Sdk="Microsoft.NET.Sdk"> +<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> - <TargetFramework>net5.0</TargetFramework> + <TargetFramework>net6.0</TargetFramework> </PropertyGroup> <ItemGroup> <AdditionalFiles Include="..\stylecop.json" Link="Properties/stylecop.json" /> diff --git a/src/Spectre.Console.Analyzer.v3.ncrunchsolution b/src/Spectre.Console.Analyzer.v3.ncrunchsolution new file mode 100644 index 0000000..10420ac --- /dev/null +++ b/src/Spectre.Console.Analyzer.v3.ncrunchsolution @@ -0,0 +1,6 @@ +<SolutionConfiguration> + <Settings> + <AllowParallelTestExecution>True</AllowParallelTestExecution> + <SolutionConfigured>True</SolutionConfigured> + </Settings> +</SolutionConfiguration> \ No newline at end of file diff --git a/src/Spectre.Console.Analyzer/Analyzers/FavorInstanceAnsiConsoleOverStaticAnalyzer.cs b/src/Spectre.Console.Analyzer/Analyzers/FavorInstanceAnsiConsoleOverStaticAnalyzer.cs index bd9bb28..eb64179 100644 --- a/src/Spectre.Console.Analyzer/Analyzers/FavorInstanceAnsiConsoleOverStaticAnalyzer.cs +++ b/src/Spectre.Console.Analyzer/Analyzers/FavorInstanceAnsiConsoleOverStaticAnalyzer.cs @@ -24,7 +24,7 @@ public class FavorInstanceAnsiConsoleOverStaticAnalyzer : SpectreAnalyzer // if this operation isn't an invocation against one of the System.Console methods // defined in _methods then we can safely stop analyzing and return; var invocationOperation = (IInvocationOperation)context.Operation; - if (!Equals(invocationOperation.TargetMethod.ContainingType, ansiConsoleType)) + if (!SymbolEqualityComparer.Default.Equals(invocationOperation.TargetMethod.ContainingType, ansiConsoleType)) { return; } @@ -63,7 +63,7 @@ public class FavorInstanceAnsiConsoleOverStaticAnalyzer : SpectreAnalyzer .Ancestors().OfType<MethodDeclarationSyntax>() .First() .ParameterList.Parameters - .Any(i => i.Type.NormalizeWhitespace().ToString() == "IAnsiConsole"); + .Any(i => i.Type?.NormalizeWhitespace()?.ToString() == "IAnsiConsole"); } private static bool HasFieldAnsiConsole(SyntaxNode syntaxNode) @@ -72,7 +72,7 @@ public class FavorInstanceAnsiConsoleOverStaticAnalyzer : SpectreAnalyzer .Ancestors() .OfType<MethodDeclarationSyntax>() .First() - .Modifiers.Any(i => i.Kind() == SyntaxKind.StaticKeyword); + .Modifiers.Any(i => i.IsKind(SyntaxKind.StaticKeyword)); return syntaxNode .Ancestors().OfType<ClassDeclarationSyntax>() @@ -81,6 +81,6 @@ public class FavorInstanceAnsiConsoleOverStaticAnalyzer : SpectreAnalyzer .OfType<FieldDeclarationSyntax>() .Any(i => i.Declaration.Type.NormalizeWhitespace().ToString() == "IAnsiConsole" && - (!isStatic ^ i.Modifiers.Any(modifier => modifier.Kind() == SyntaxKind.StaticKeyword))); + (!isStatic ^ i.Modifiers.Any(modifier => modifier.IsKind(SyntaxKind.StaticKeyword)))); } } \ No newline at end of file diff --git a/src/Spectre.Console.Analyzer/Analyzers/NoConcurrentLiveRenderablesAnalyzer.cs b/src/Spectre.Console.Analyzer/Analyzers/NoConcurrentLiveRenderablesAnalyzer.cs index 9aa59d4..4565b64 100644 --- a/src/Spectre.Console.Analyzer/Analyzers/NoConcurrentLiveRenderablesAnalyzer.cs +++ b/src/Spectre.Console.Analyzer/Analyzers/NoConcurrentLiveRenderablesAnalyzer.cs @@ -33,12 +33,14 @@ public class NoConcurrentLiveRenderablesAnalyzer : SpectreAnalyzer .Select(i => context.Compilation.GetTypeByMetadataName(i)) .ToImmutableArray(); - if (liveTypes.All(i => !Equals(i, methodSymbol.ContainingType))) + if (liveTypes.All(i => !SymbolEqualityComparer.Default.Equals(i, methodSymbol.ContainingType))) { return; } +#pragma warning disable RS1030 // Do not invoke Compilation.GetSemanticModel() method within a diagnostic analyzer var model = context.Compilation.GetSemanticModel(context.Operation.Syntax.SyntaxTree); +#pragma warning restore RS1030 // Do not invoke Compilation.GetSemanticModel() method within a diagnostic analyzer var parentInvocations = invocationOperation .Syntax.Ancestors() .OfType<InvocationExpressionSyntax>() diff --git a/src/Spectre.Console.Analyzer/Analyzers/NoPromptsDuringLiveRenderablesAnalyzer.cs b/src/Spectre.Console.Analyzer/Analyzers/NoPromptsDuringLiveRenderablesAnalyzer.cs index 8e87ef9..ba47b2f 100644 --- a/src/Spectre.Console.Analyzer/Analyzers/NoPromptsDuringLiveRenderablesAnalyzer.cs +++ b/src/Spectre.Console.Analyzer/Analyzers/NoPromptsDuringLiveRenderablesAnalyzer.cs @@ -34,12 +34,15 @@ public class NoPromptsDuringLiveRenderablesAnalyzer : SpectreAnalyzer var ansiConsoleType = context.Compilation.GetTypeByMetadataName("Spectre.Console.AnsiConsole"); var ansiConsoleExtensionsType = context.Compilation.GetTypeByMetadataName("Spectre.Console.AnsiConsoleExtensions"); - if (!Equals(methodSymbol.ContainingType, ansiConsoleType) && !Equals(methodSymbol.ContainingType, ansiConsoleExtensionsType)) + if (!SymbolEqualityComparer.Default.Equals(methodSymbol.ContainingType, ansiConsoleType) && + !SymbolEqualityComparer.Default.Equals(methodSymbol.ContainingType, ansiConsoleExtensionsType)) { return; } +#pragma warning disable RS1030 // Do not invoke Compilation.GetSemanticModel() method within a diagnostic analyzer var model = context.Compilation.GetSemanticModel(context.Operation.Syntax.SyntaxTree); +#pragma warning restore RS1030 // Do not invoke Compilation.GetSemanticModel() method within a diagnostic analyzer var parentInvocations = invocationOperation .Syntax.Ancestors() .OfType<InvocationExpressionSyntax>() diff --git a/src/Spectre.Console.Analyzer/Analyzers/UseSpectreInsteadOfSystemConsoleAnalyzer.cs b/src/Spectre.Console.Analyzer/Analyzers/UseSpectreInsteadOfSystemConsoleAnalyzer.cs index 3c91f1d..3836a32 100644 --- a/src/Spectre.Console.Analyzer/Analyzers/UseSpectreInsteadOfSystemConsoleAnalyzer.cs +++ b/src/Spectre.Console.Analyzer/Analyzers/UseSpectreInsteadOfSystemConsoleAnalyzer.cs @@ -33,7 +33,7 @@ public class UseSpectreInsteadOfSystemConsoleAnalyzer : SpectreAnalyzer var systemConsoleType = context.Compilation.GetTypeByMetadataName("System.Console"); - if (!Equals(invocationOperation.TargetMethod.ContainingType, systemConsoleType)) + if (!SymbolEqualityComparer.Default.Equals(invocationOperation.TargetMethod.ContainingType, systemConsoleType)) { return; } diff --git a/src/Spectre.Console.Analyzer/Fixes/CodeActions/SwitchToAnsiConsoleAction.cs b/src/Spectre.Console.Analyzer/Fixes/CodeActions/SwitchToAnsiConsoleAction.cs index f4421ef..11a1e17 100644 --- a/src/Spectre.Console.Analyzer/Fixes/CodeActions/SwitchToAnsiConsoleAction.cs +++ b/src/Spectre.Console.Analyzer/Fixes/CodeActions/SwitchToAnsiConsoleAction.cs @@ -35,6 +35,11 @@ public class SwitchToAnsiConsoleAction : CodeAction var originalCaller = ((MemberAccessExpressionSyntax)_originalInvocation.Expression).Name.ToString(); var syntaxTree = await _document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); + if (syntaxTree == null) + { + return _document; + } + var root = (CompilationUnitSyntax)await syntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); // If there is an ansiConsole passed into the method then we'll use it. @@ -66,7 +71,7 @@ public class SwitchToAnsiConsoleAction : CodeAction .Ancestors().OfType<MethodDeclarationSyntax>() .First() .ParameterList.Parameters - .FirstOrDefault(i => i.Type.NormalizeWhitespace().ToString() == "IAnsiConsole") + .FirstOrDefault(i => i.Type?.NormalizeWhitespace()?.ToString() == "IAnsiConsole") ?.Identifier.Text; } @@ -79,7 +84,7 @@ public class SwitchToAnsiConsoleAction : CodeAction .Ancestors() .OfType<MethodDeclarationSyntax>() .First() - .Modifiers.Any(i => i.Kind() == SyntaxKind.StaticKeyword); + .Modifiers.Any(i => i.IsKind(SyntaxKind.StaticKeyword)); return _originalInvocation .Ancestors().OfType<ClassDeclarationSyntax>() @@ -88,7 +93,7 @@ public class SwitchToAnsiConsoleAction : CodeAction .OfType<FieldDeclarationSyntax>() .FirstOrDefault(i => i.Declaration.Type.NormalizeWhitespace().ToString() == "IAnsiConsole" && - (!isStatic ^ i.Modifiers.Any(modifier => modifier.Kind() == SyntaxKind.StaticKeyword))) + (!isStatic ^ i.Modifiers.Any(modifier => modifier.IsKind(SyntaxKind.StaticKeyword)))) ?.Declaration.Variables.First().Identifier.Text; } diff --git a/src/Spectre.Console.Analyzer/Fixes/FixProviders/StaticAnsiConsoleToInstanceFix.cs b/src/Spectre.Console.Analyzer/Fixes/FixProviders/StaticAnsiConsoleToInstanceFix.cs index 3a73748..dfed1f3 100644 --- a/src/Spectre.Console.Analyzer/Fixes/FixProviders/StaticAnsiConsoleToInstanceFix.cs +++ b/src/Spectre.Console.Analyzer/Fixes/FixProviders/StaticAnsiConsoleToInstanceFix.cs @@ -18,9 +18,18 @@ public class StaticAnsiConsoleToInstanceFix : CodeFixProvider public override async Task RegisterCodeFixesAsync(CodeFixContext context) { var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); - var methodDeclaration = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>(); - context.RegisterCodeFix( - new SwitchToAnsiConsoleAction(context.Document, methodDeclaration, "Convert static AnsiConsole calls to local instance."), - context.Diagnostics); + if (root != null) + { + var methodDeclaration = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>(); + if (methodDeclaration != null) + { + context.RegisterCodeFix( + new SwitchToAnsiConsoleAction( + context.Document, + methodDeclaration, + "Convert static AnsiConsole calls to local instance."), + context.Diagnostics); + } + } } } \ No newline at end of file diff --git a/src/Spectre.Console.Analyzer/Fixes/FixProviders/SystemConsoleToAnsiConsoleFix.cs b/src/Spectre.Console.Analyzer/Fixes/FixProviders/SystemConsoleToAnsiConsoleFix.cs index eeee888..a90d99d 100644 --- a/src/Spectre.Console.Analyzer/Fixes/FixProviders/SystemConsoleToAnsiConsoleFix.cs +++ b/src/Spectre.Console.Analyzer/Fixes/FixProviders/SystemConsoleToAnsiConsoleFix.cs @@ -18,9 +18,18 @@ public class SystemConsoleToAnsiConsoleFix : CodeFixProvider public override async Task RegisterCodeFixesAsync(CodeFixContext context) { var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); - var methodDeclaration = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>(); - context.RegisterCodeFix( - new SwitchToAnsiConsoleAction(context.Document, methodDeclaration, "Convert static call to AnsiConsole to Spectre.Console.AnsiConsole"), - context.Diagnostics); + if (root != null) + { + var methodDeclaration = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>(); + if (methodDeclaration != null) + { + context.RegisterCodeFix( + new SwitchToAnsiConsoleAction( + context.Document, + methodDeclaration, + "Convert static call to AnsiConsole to Spectre.Console.AnsiConsole"), + context.Diagnostics); + } + } } } \ No newline at end of file diff --git a/src/Spectre.Console.Analyzer/Spectre.Console.Analyzer.csproj b/src/Spectre.Console.Analyzer/Spectre.Console.Analyzer.csproj index e97d094..39b9187 100644 --- a/src/Spectre.Console.Analyzer/Spectre.Console.Analyzer.csproj +++ b/src/Spectre.Console.Analyzer/Spectre.Console.Analyzer.csproj @@ -1,4 +1,4 @@ -<Project Sdk="Microsoft.NET.Sdk"> +<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <Description>Best practice analyzers for Spectre.Console.</Description> @@ -15,9 +15,10 @@ </ItemGroup> <ItemGroup> - <PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="2.9.8" PrivateAssets="all" /> - <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.6.1" PrivateAssets="all" /> - <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.6.1" PrivateAssets="all" /> + <PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" PrivateAssets="all" /> + <PackageReference Include="Microsoft.CodeAnalysis" Version="4.2.0" PrivateAssets="all" /> + <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.2.0" PrivateAssets="all" /> + <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.2.0" PrivateAssets="all" /> </ItemGroup> <ItemGroup> diff --git a/src/Spectre.Console.Cli/Spectre.Console.Cli.csproj b/src/Spectre.Console.Cli/Spectre.Console.Cli.csproj index 881d7cb..42fe922 100644 --- a/src/Spectre.Console.Cli/Spectre.Console.Cli.csproj +++ b/src/Spectre.Console.Cli/Spectre.Console.Cli.csproj @@ -1,7 +1,7 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <TargetFrameworks>net6.0;net5.0;netstandard2.0</TargetFrameworks> + <TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks> <Nullable>enable</Nullable> <IsPackable>true</IsPackable> <NoWarn>SA1633</NoWarn> diff --git a/src/Spectre.Console.ImageSharp/Spectre.Console.ImageSharp.csproj b/src/Spectre.Console.ImageSharp/Spectre.Console.ImageSharp.csproj index e15af2b..5564af2 100644 --- a/src/Spectre.Console.ImageSharp/Spectre.Console.ImageSharp.csproj +++ b/src/Spectre.Console.ImageSharp/Spectre.Console.ImageSharp.csproj @@ -1,7 +1,7 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <TargetFrameworks>net6.0;net5.0;netstandard2.0</TargetFrameworks> + <TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks> <Nullable>enable</Nullable> <IsPackable>true</IsPackable> <Description>A library that extends Spectre.Console with ImageSharp superpowers.</Description> @@ -13,7 +13,7 @@ </ItemGroup> <ItemGroup> - <PackageReference Include="SixLabors.ImageSharp" Version="2.0.0" /> + <PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" /> </ItemGroup> <ItemGroup> diff --git a/src/Spectre.Console.Testing/Spectre.Console.Testing.csproj b/src/Spectre.Console.Testing/Spectre.Console.Testing.csproj index c81ef03..851b890 100644 --- a/src/Spectre.Console.Testing/Spectre.Console.Testing.csproj +++ b/src/Spectre.Console.Testing/Spectre.Console.Testing.csproj @@ -1,7 +1,7 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <TargetFrameworks>net6.0;net5.0;netstandard2.0</TargetFrameworks> + <TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks> <IsTestProject>false</IsTestProject> <Nullable>enable</Nullable> <IsPackable>true</IsPackable> diff --git a/src/Spectre.Console/Spectre.Console.csproj b/src/Spectre.Console/Spectre.Console.csproj index f12db11..034f292 100644 --- a/src/Spectre.Console/Spectre.Console.csproj +++ b/src/Spectre.Console/Spectre.Console.csproj @@ -1,14 +1,14 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <TargetFrameworks>net6.0;net5.0;netstandard2.0</TargetFrameworks> + <TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks> <Nullable>enable</Nullable> <IsPackable>true</IsPackable> <NoWarn>SA1633</NoWarn> </PropertyGroup> <ItemGroup> - <PackageReference Include="System.Memory" Version="4.5.0" Condition="'$(TargetFramework)' == 'netstandard2.0'" /> + <PackageReference Include="System.Memory" Version="4.5.5" Condition="'$(TargetFramework)' == 'netstandard2.0'" /> </ItemGroup> <ItemGroup> @@ -20,6 +20,7 @@ </ItemGroup> <ItemGroup> + <PackageReference Include="System.Memory" Version="4.5.5" /> <PackageReference Include="TunnelVisionLabs.ReferenceAssemblyAnnotator" Version="1.0.0-alpha.160" PrivateAssets="all" /> <PackageDownload Include="Microsoft.NETCore.App.Ref" Version="[$(AnnotatedReferenceAssemblyVersion)]" /> <PackageReference Include="Nullable" Version="1.3.0"> diff --git a/test/Directory.Build.props b/test/Directory.Build.props index c6403bb..88ea545 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -6,10 +6,10 @@ </PropertyGroup> <ItemGroup Label="Package References"> - <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.312"> + <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435"> <PrivateAssets>All</PrivateAssets> </PackageReference> - <PackageReference Include="Roslynator.Analyzers" Version="3.3.0"> + <PackageReference Include="Roslynator.Analyzers" Version="4.1.1"> <PrivateAssets>All</PrivateAssets> </PackageReference> </ItemGroup> diff --git a/test/Spectre.Console.Analyzer.Tests/CodeAnalyzerHelper.cs b/test/Spectre.Console.Analyzer.Tests/CodeAnalyzerHelper.cs index 4312995..860fcc8 100644 --- a/test/Spectre.Console.Analyzer.Tests/CodeAnalyzerHelper.cs +++ b/test/Spectre.Console.Analyzer.Tests/CodeAnalyzerHelper.cs @@ -6,7 +6,7 @@ internal static class CodeAnalyzerHelper static CodeAnalyzerHelper() { - CurrentSpectre = ReferenceAssemblies.Net.Net50.AddAssemblies( + CurrentSpectre = ReferenceAssemblies.Net.Net60.AddAssemblies( ImmutableArray.Create(typeof(AnsiConsole).Assembly.Location.Replace(".dll", string.Empty))); } } diff --git a/test/Spectre.Console.Analyzer.Tests/Spectre.Console.Analyzer.Tests.csproj b/test/Spectre.Console.Analyzer.Tests/Spectre.Console.Analyzer.Tests.csproj index 3e1881a..e66b180 100644 --- a/test/Spectre.Console.Analyzer.Tests/Spectre.Console.Analyzer.Tests.csproj +++ b/test/Spectre.Console.Analyzer.Tests/Spectre.Console.Analyzer.Tests.csproj @@ -1,7 +1,7 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <TargetFramework>net5.0</TargetFramework> + <TargetFramework>net6.0</TargetFramework> <IsPackable>false</IsPackable> </PropertyGroup> @@ -10,12 +10,12 @@ </ItemGroup> <ItemGroup> - <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="1.1.0" /> - <PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="1.1.0" /> - <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.6.1" /> - <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" /> + <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="1.1.1" /> + <PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="1.1.1" /> + <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.2.0" /> + <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" /> <PackageReference Include="xunit" Version="2.4.1" /> - <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> + <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <PrivateAssets>all</PrivateAssets> </PackageReference> diff --git a/test/Spectre.Console.Analyzer.Tests/SpectreAnalyzerVerifier.cs b/test/Spectre.Console.Analyzer.Tests/SpectreAnalyzerVerifier.cs index 91c503d..8aadab6 100644 --- a/test/Spectre.Console.Analyzer.Tests/SpectreAnalyzerVerifier.cs +++ b/test/Spectre.Console.Analyzer.Tests/SpectreAnalyzerVerifier.cs @@ -8,14 +8,6 @@ public static class SpectreAnalyzerVerifier<TAnalyzer> private static Task VerifyCodeFixAsync(string source, IEnumerable<DiagnosticResult> expected, string fixedSource) { - // Roslyn fixers always use \r\n for newlines, regardless of OS environment settings, so we normalize - // the source as it typically comes from multi-line strings with varying newlines. - if (Environment.NewLine != "\r\n") - { - source = source.Replace(Environment.NewLine, "\r\n"); - fixedSource = fixedSource.Replace(Environment.NewLine, "\r\n"); - } - var test = new Test { TestCode = source, diff --git a/test/Spectre.Console.Cli.Tests/Properties/Usings.cs b/test/Spectre.Console.Cli.Tests/Properties/Usings.cs index 41d63b8..be00c04 100644 --- a/test/Spectre.Console.Cli.Tests/Properties/Usings.cs +++ b/test/Spectre.Console.Cli.Tests/Properties/Usings.cs @@ -11,7 +11,6 @@ global using Spectre.Console.Cli; global using Spectre.Console.Cli.Unsafe; global using Spectre.Console.Testing; global using Spectre.Console.Tests.Data; -global using Spectre.Verify.Extensions; global using VerifyTests; global using VerifyXunit; global using Xunit; \ No newline at end of file diff --git a/test/Spectre.Console.Cli.Tests/Spectre.Console.Cli.Tests.csproj b/test/Spectre.Console.Cli.Tests/Spectre.Console.Cli.Tests.csproj index c9c33c7..68a74c8 100644 --- a/test/Spectre.Console.Cli.Tests/Spectre.Console.Cli.Tests.csproj +++ b/test/Spectre.Console.Cli.Tests/Spectre.Console.Cli.Tests.csproj @@ -1,8 +1,8 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">net6.0;net5.0;net48</TargetFrameworks> - <TargetFrameworks Condition="!$([MSBuild]::IsOSPlatform('Windows'))">net6.0;net5.0</TargetFrameworks> + <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">net6.0;net48</TargetFrameworks> + <TargetFrameworks Condition="!$([MSBuild]::IsOSPlatform('Windows'))">net6.0</TargetFrameworks> </PropertyGroup> <ItemGroup> @@ -10,16 +10,16 @@ </ItemGroup> <ItemGroup> - <PackageReference Include="IsExternalInit" Version="1.0.1" PrivateAssets="all" /> + <PackageReference Include="IsExternalInit" Version="1.0.2" PrivateAssets="all" /> <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="1.1.0" /> <PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="1.1.0" /> <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.6.1" /> - <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" /> + <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" /> <PackageReference Include="Shouldly" Version="4.0.3" /> - <PackageReference Include="Spectre.Verify.Extensions" Version="0.3.0" /> - <PackageReference Include="Verify.Xunit" Version="9.0.0-beta.1" /> + <PackageReference Include="Spectre.Verify.Extensions" Version="17.1.6" /> + <PackageReference Include="Verify.Xunit" Version="17.1.6" /> <PackageReference Include="xunit" Version="2.4.1" /> - <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> + <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> diff --git a/test/Spectre.Console.Tests/Properties/Usings.cs b/test/Spectre.Console.Tests/Properties/Usings.cs index 95304af..cd79736 100644 --- a/test/Spectre.Console.Tests/Properties/Usings.cs +++ b/test/Spectre.Console.Tests/Properties/Usings.cs @@ -13,7 +13,6 @@ global using Spectre.Console.Advanced; global using Spectre.Console.Rendering; global using Spectre.Console.Testing; global using Spectre.Console.Tests.Data; -global using Spectre.Verify.Extensions; global using VerifyTests; global using VerifyXunit; global using Xunit; \ No newline at end of file diff --git a/test/Spectre.Console.Tests/Spectre.Console.Tests.csproj b/test/Spectre.Console.Tests/Spectre.Console.Tests.csproj index cd498d7..ea2c3fa 100644 --- a/test/Spectre.Console.Tests/Spectre.Console.Tests.csproj +++ b/test/Spectre.Console.Tests/Spectre.Console.Tests.csproj @@ -1,8 +1,8 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">net6.0;net5.0;net48</TargetFrameworks> - <TargetFrameworks Condition="!$([MSBuild]::IsOSPlatform('Windows'))">net6.0;net5.0</TargetFrameworks> + <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">net6.0;net48</TargetFrameworks> + <TargetFrameworks Condition="!$([MSBuild]::IsOSPlatform('Windows'))">net6.0</TargetFrameworks> </PropertyGroup> <ItemGroup> @@ -12,16 +12,16 @@ </ItemGroup> <ItemGroup> - <PackageReference Include="IsExternalInit" Version="1.0.1" PrivateAssets="all" /> + <PackageReference Include="IsExternalInit" Version="1.0.2" PrivateAssets="all" /> <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="1.1.0" /> <PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="1.1.0" /> <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.6.1" /> - <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" /> + <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" /> <PackageReference Include="Shouldly" Version="4.0.3" /> - <PackageReference Include="Spectre.Verify.Extensions" Version="0.3.0" /> - <PackageReference Include="Verify.Xunit" Version="9.0.0-beta.1" /> + <PackageReference Include="Spectre.Verify.Extensions" Version="17.1.6" /> + <PackageReference Include="Verify.Xunit" Version="17.1.6" /> <PackageReference Include="xunit" Version="2.4.1" /> - <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> + <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> @@ -33,9 +33,4 @@ <ProjectReference Include="..\..\src\Spectre.Console\Spectre.Console.csproj" /> </ItemGroup> - <ItemGroup> - <Folder Include="Expectations\Widgets\Table\Rows\Extensions\" /> - <Folder Include="Expectations\Widgets\Tree\" /> - </ItemGroup> - </Project>