6 Commits

Author SHA1 Message Date
Tyrrrz
432c8a66af Merge master 2025-02-02 21:50:01 +02:00
Tyrrrz
078ddeaf07 Handle breaking changes 2025-02-02 21:49:30 +02:00
Tyrrrz
0fa2ebc636 asd 2025-02-02 21:40:41 +02:00
dependabot[bot]
c79a8c6502 Bump the nuget group with 8 updates (#152)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-02 21:36:15 +02:00
dependabot[bot]
cfbd8f9e76 Bump the nuget group with 4 updates (#151)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-01 18:18:20 +02:00
dependabot[bot]
e329f0fc78 Bump the nuget group with 6 updates (#150)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-01 18:44:30 +02:00
8 changed files with 60 additions and 63 deletions

View File

@@ -11,7 +11,7 @@
<PackageReference Include="clipr" Version="1.6.1" />
<PackageReference Include="Cocona" Version="2.2.0" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="CSharpier.MsBuild" Version="0.29.2" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.30.6" PrivateAssets="all" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
<PackageReference Include="PowerArgs" Version="4.0.3" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />

View File

@@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.29.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageReference Include="CSharpier.MsBuild" Version="0.30.6" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.1" />
</ItemGroup>
<ItemGroup>

View File

@@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.29.2" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.30.6" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>

View File

@@ -9,18 +9,18 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Basic.Reference.Assemblies.Net80" Version="1.7.9" />
<PackageReference Include="CliWrap" Version="3.6.7" />
<PackageReference Include="coverlet.collector" Version="6.0.2" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.29.2" PrivateAssets="all" />
<PackageReference Include="FluentAssertions" Version="6.12.1" />
<PackageReference Include="Basic.Reference.Assemblies.Net80" Version="1.8.0" />
<PackageReference Include="CliWrap" Version="3.7.1" />
<PackageReference Include="coverlet.collector" Version="6.0.4" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.30.6" PrivateAssets="all" />
<PackageReference Include="FluentAssertions" Version="8.0.1" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="PolyShim" Version="1.14.0" PrivateAssets="all" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" PrivateAssets="all" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using FluentAssertions;
using FluentAssertions.Execution;
using FluentAssertions.Primitives;
namespace CliFx.Tests.Utils.Extensions;
@@ -13,7 +12,7 @@ internal static class AssertionExtensions
params IEnumerable<string> lines
) =>
assertions
.Subject.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries)
.Subject.Split(['\n', '\r'], StringSplitOptions.RemoveEmptyEntries)
.Should()
.Equal(lines);
@@ -30,7 +29,7 @@ internal static class AssertionExtensions
if (index < 0)
{
Execute.Assertion.FailWith(
assertions.CurrentAssertionChain.FailWith(
$"Expected string '{assertions.Subject}' to contain '{value}' after position {lastIndex}."
);
}

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0;net9.0</TargetFrameworks>
<IsPackable>true</IsPackable>
<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible>
@@ -23,10 +23,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.29.2" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.30.6" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="all" />
<PackageReference Include="PolyShim" Version="1.13.0" PrivateAssets="all" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
<PackageReference Include="PolyShim" Version="1.14.0" PrivateAssets="all" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.6.0" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
</ItemGroup>
<!-- Embed the analyzer inside the package -->

View File

@@ -6,12 +6,11 @@ namespace CliFx.Utils;
internal static class EnvironmentEx
{
private static readonly Lazy<string?> ProcessPathLazy =
new(() =>
{
using var process = Process.GetCurrentProcess();
return process.MainModule?.FileName;
});
private static readonly Lazy<string?> ProcessPathLazy = new(() =>
{
using var process = Process.GetCurrentProcess();
return process.MainModule?.FileName;
});
public static string? ProcessPath => ProcessPathLazy.Value;

View File

@@ -38,43 +38,42 @@ internal partial class StackFrame
private const string NotSpace = @"[^\x20\t]";
// Taken from https://github.com/atifaziz/StackTraceParser
private static readonly Regex Pattern =
new(
$$"""
^
{{Space}}*
\w+ {{Space}}+
(?<frame>
(?<type> {{NotSpace}}+ ) \.
(?<method> {{NotSpace}}+? ) {{Space}}*
(?<params> \( ( {{Space}}* \)
| (?<pt> .+?) {{Space}}+ (?<pn> .+?)
(, {{Space}}* (?<pt> .+?) {{Space}}+ (?<pn> .+?) )* \) ) )
( {{Space}}+
( # Microsoft .NET stack traces
\w+ {{Space}}+
(?<file> ( [a-z] \: # Windows rooted path starting with a drive letter
| / ) # Unix rooted path starting with a forward-slash
.+? )
\: \w+ {{Space}}+
(?<line> [0-9]+ ) \p{P}?
| # Mono stack traces
\[0x[0-9a-f]+\] {{Space}}+ \w+ {{Space}}+
<(?<file> [^>]+ )>
:(?<line> [0-9]+ )
)
)?
)
\s*
$
""",
RegexOptions.IgnoreCase
| RegexOptions.Multiline
| RegexOptions.ExplicitCapture
| RegexOptions.CultureInvariant
| RegexOptions.IgnorePatternWhitespace,
TimeSpan.FromSeconds(5)
);
private static readonly Regex Pattern = new(
$$"""
^
{{Space}}*
\w+ {{Space}}+
(?<frame>
(?<type> {{NotSpace}}+ ) \.
(?<method> {{NotSpace}}+? ) {{Space}}*
(?<params> \( ( {{Space}}* \)
| (?<pt> .+?) {{Space}}+ (?<pn> .+?)
(, {{Space}}* (?<pt> .+?) {{Space}}+ (?<pn> .+?) )* \) ) )
( {{Space}}+
( # Microsoft .NET stack traces
\w+ {{Space}}+
(?<file> ( [a-z] \: # Windows rooted path starting with a drive letter
| / ) # Unix rooted path starting with a forward-slash
.+? )
\: \w+ {{Space}}+
(?<line> [0-9]+ ) \p{P}?
| # Mono stack traces
\[0x[0-9a-f]+\] {{Space}}+ \w+ {{Space}}+
<(?<file> [^>]+ )>
:(?<line> [0-9]+ )
)
)?
)
\s*
$
""",
RegexOptions.IgnoreCase
| RegexOptions.Multiline
| RegexOptions.ExplicitCapture
| RegexOptions.CultureInvariant
| RegexOptions.IgnorePatternWhitespace,
TimeSpan.FromSeconds(5)
);
public static IEnumerable<StackFrame> ParseTrace(string stackTrace)
{