From e99a95ef7c1cbf19ea152cfe2fcad642b2ec2b9f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 22:54:53 +0300 Subject: [PATCH 1/7] Bump the nuget group with 2 updates (#145) Bumps the nuget group with 2 updates: [xunit](https://github.com/xunit/xunit) and [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit). Updates `xunit` from 2.8.1 to 2.9.0 - [Commits](https://github.com/xunit/xunit/compare/2.8.1...2.9.0) Updates `xunit.runner.visualstudio` from 2.8.1 to 2.8.2 - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/compare/2.8.1...2.8.2) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: nuget - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-patch dependency-group: nuget ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj | 4 ++-- CliFx.Tests/CliFx.Tests.csproj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj b/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj index 019c240..a23e7ba 100644 --- a/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj +++ b/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj @@ -16,8 +16,8 @@ - - + + diff --git a/CliFx.Tests/CliFx.Tests.csproj b/CliFx.Tests/CliFx.Tests.csproj index c52c68e..0280418 100644 --- a/CliFx.Tests/CliFx.Tests.csproj +++ b/CliFx.Tests/CliFx.Tests.csproj @@ -19,8 +19,8 @@ - - + + From ab48098e0675fd8f3baac693afd794df9b5c26cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Sep 2024 19:05:41 +0300 Subject: [PATCH 2/7] Bump the nuget group with 5 updates (#146) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj | 6 +++--- CliFx.Analyzers/CliFx.Analyzers.csproj | 2 +- CliFx.Benchmarks/CliFx.Benchmarks.csproj | 4 ++-- CliFx.Demo/CliFx.Demo.csproj | 2 +- CliFx.Tests.Dummy/CliFx.Tests.Dummy.csproj | 2 +- CliFx.Tests/CliFx.Tests.csproj | 6 +++--- CliFx/CliFx.csproj | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj b/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj index a23e7ba..565388a 100644 --- a/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj +++ b/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj @@ -9,12 +9,12 @@ - + - + - + diff --git a/CliFx.Analyzers/CliFx.Analyzers.csproj b/CliFx.Analyzers/CliFx.Analyzers.csproj index 10b7043..b62aff6 100644 --- a/CliFx.Analyzers/CliFx.Analyzers.csproj +++ b/CliFx.Analyzers/CliFx.Analyzers.csproj @@ -17,7 +17,7 @@ - + diff --git a/CliFx.Benchmarks/CliFx.Benchmarks.csproj b/CliFx.Benchmarks/CliFx.Benchmarks.csproj index 40b5172..5e1f916 100644 --- a/CliFx.Benchmarks/CliFx.Benchmarks.csproj +++ b/CliFx.Benchmarks/CliFx.Benchmarks.csproj @@ -6,11 +6,11 @@ - + - + diff --git a/CliFx.Demo/CliFx.Demo.csproj b/CliFx.Demo/CliFx.Demo.csproj index 4d4439a..21a61b0 100644 --- a/CliFx.Demo/CliFx.Demo.csproj +++ b/CliFx.Demo/CliFx.Demo.csproj @@ -7,7 +7,7 @@ - + diff --git a/CliFx.Tests.Dummy/CliFx.Tests.Dummy.csproj b/CliFx.Tests.Dummy/CliFx.Tests.Dummy.csproj index 7feda9b..444e2c3 100644 --- a/CliFx.Tests.Dummy/CliFx.Tests.Dummy.csproj +++ b/CliFx.Tests.Dummy/CliFx.Tests.Dummy.csproj @@ -7,7 +7,7 @@ - + diff --git a/CliFx.Tests/CliFx.Tests.csproj b/CliFx.Tests/CliFx.Tests.csproj index 0280418..3ddb1bf 100644 --- a/CliFx.Tests/CliFx.Tests.csproj +++ b/CliFx.Tests/CliFx.Tests.csproj @@ -9,15 +9,15 @@ - + - + - + diff --git a/CliFx/CliFx.csproj b/CliFx/CliFx.csproj index 8fabcdb..de06dbc 100644 --- a/CliFx/CliFx.csproj +++ b/CliFx/CliFx.csproj @@ -21,7 +21,7 @@ - + From e4671e50bb6881b75973aee0b249dab2f64b775c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 21:35:02 +0300 Subject: [PATCH 3/7] Bump the nuget group with 3 updates (#147) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj | 2 +- CliFx.Analyzers/CliFx.Analyzers.csproj | 4 ++-- CliFx.Benchmarks/CliFx.Benchmarks.csproj | 2 +- CliFx.Demo/CliFx.Demo.csproj | 2 +- CliFx.Tests.Dummy/CliFx.Tests.Dummy.csproj | 2 +- CliFx.Tests/CliFx.Tests.csproj | 2 +- CliFx/CliFx.csproj | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj b/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj index 565388a..a54a4d0 100644 --- a/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj +++ b/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj @@ -9,7 +9,7 @@ - + diff --git a/CliFx.Analyzers/CliFx.Analyzers.csproj b/CliFx.Analyzers/CliFx.Analyzers.csproj index b62aff6..dd94232 100644 --- a/CliFx.Analyzers/CliFx.Analyzers.csproj +++ b/CliFx.Analyzers/CliFx.Analyzers.csproj @@ -17,11 +17,11 @@ - + - + \ No newline at end of file diff --git a/CliFx.Benchmarks/CliFx.Benchmarks.csproj b/CliFx.Benchmarks/CliFx.Benchmarks.csproj index 5e1f916..cd9c097 100644 --- a/CliFx.Benchmarks/CliFx.Benchmarks.csproj +++ b/CliFx.Benchmarks/CliFx.Benchmarks.csproj @@ -10,7 +10,7 @@ - + diff --git a/CliFx.Demo/CliFx.Demo.csproj b/CliFx.Demo/CliFx.Demo.csproj index 21a61b0..67eeaac 100644 --- a/CliFx.Demo/CliFx.Demo.csproj +++ b/CliFx.Demo/CliFx.Demo.csproj @@ -7,7 +7,7 @@ - + diff --git a/CliFx.Tests.Dummy/CliFx.Tests.Dummy.csproj b/CliFx.Tests.Dummy/CliFx.Tests.Dummy.csproj index 444e2c3..849e0d0 100644 --- a/CliFx.Tests.Dummy/CliFx.Tests.Dummy.csproj +++ b/CliFx.Tests.Dummy/CliFx.Tests.Dummy.csproj @@ -7,7 +7,7 @@ - + diff --git a/CliFx.Tests/CliFx.Tests.csproj b/CliFx.Tests/CliFx.Tests.csproj index 3ddb1bf..5de0417 100644 --- a/CliFx.Tests/CliFx.Tests.csproj +++ b/CliFx.Tests/CliFx.Tests.csproj @@ -9,7 +9,7 @@ - + diff --git a/CliFx/CliFx.csproj b/CliFx/CliFx.csproj index de06dbc..acf1070 100644 --- a/CliFx/CliFx.csproj +++ b/CliFx/CliFx.csproj @@ -21,9 +21,9 @@ - + - + From 093b6767c46a8357556786325c27cad54188990a Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Tue, 1 Oct 2024 21:49:03 +0300 Subject: [PATCH 4/7] Resolve dependency conflicts --- CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj | 2 +- CliFx.Analyzers.Tests/Utils/AnalyzerAssertions.cs | 2 +- CliFx.Tests/CliFx.Tests.csproj | 2 +- CliFx.Tests/Utils/DynamicCommandBuilder.cs | 2 +- CliFx/Input/OptionInput.cs | 2 +- CliFx/Schema/IMemberSchema.cs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj b/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj index a54a4d0..e8c7ce8 100644 --- a/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj +++ b/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/CliFx.Analyzers.Tests/Utils/AnalyzerAssertions.cs b/CliFx.Analyzers.Tests/Utils/AnalyzerAssertions.cs index 4475db6..db20562 100644 --- a/CliFx.Analyzers.Tests/Utils/AnalyzerAssertions.cs +++ b/CliFx.Analyzers.Tests/Utils/AnalyzerAssertions.cs @@ -25,7 +25,7 @@ internal class AnalyzerAssertions(DiagnosticAnalyzer analyzer) { "System", "System.Collections.Generic", - "System.Threading.Tasks" + "System.Threading.Tasks", }; // Get default CliFx namespaces diff --git a/CliFx.Tests/CliFx.Tests.csproj b/CliFx.Tests/CliFx.Tests.csproj index 5de0417..2883351 100644 --- a/CliFx.Tests/CliFx.Tests.csproj +++ b/CliFx.Tests/CliFx.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/CliFx.Tests/Utils/DynamicCommandBuilder.cs b/CliFx.Tests/Utils/DynamicCommandBuilder.cs index 9a2f3f7..394a23e 100644 --- a/CliFx.Tests/Utils/DynamicCommandBuilder.cs +++ b/CliFx.Tests/Utils/DynamicCommandBuilder.cs @@ -27,7 +27,7 @@ internal static class DynamicCommandBuilder "System.Collections.Generic", "System.Linq", "System.Threading.Tasks", - "System.Globalization" + "System.Globalization", }; // Get default CliFx namespaces diff --git a/CliFx/Input/OptionInput.cs b/CliFx/Input/OptionInput.cs index 257340a..805d4f3 100644 --- a/CliFx/Input/OptionInput.cs +++ b/CliFx/Input/OptionInput.cs @@ -17,6 +17,6 @@ internal class OptionInput(string identifier, IReadOnlyList values) Identifier switch { { Length: >= 2 } => "--" + Identifier, - _ => '-' + Identifier + _ => '-' + Identifier, }; } diff --git a/CliFx/Schema/IMemberSchema.cs b/CliFx/Schema/IMemberSchema.cs index 59919c9..87f9cea 100644 --- a/CliFx/Schema/IMemberSchema.cs +++ b/CliFx/Schema/IMemberSchema.cs @@ -21,6 +21,6 @@ internal static class MemberSchemaExtensions { ParameterSchema => "Parameter", OptionSchema => "Option", - _ => throw new ArgumentOutOfRangeException(nameof(memberSchema)) + _ => throw new ArgumentOutOfRangeException(nameof(memberSchema)), }; } From 73bf19d7664d5dee5732297f1646e30015b98a9d Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Sat, 26 Oct 2024 21:51:37 +0300 Subject: [PATCH 5/7] Add readme note about keyed services with `M.E.DI` Related to #148 --- Readme.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Readme.md b/Readme.md index bd06626..2de849c 100644 --- a/Readme.md +++ b/Readme.md @@ -578,6 +578,10 @@ public static class Program } ``` +> **Note**: +> If you want to use certain advanced features provided by `Microsoft.Extensions.DependencyInjection`, you may need to do a bit of extra work to configure the container properly. +> For example, to leverage support for keyed services, you need to [manually register an implementation of `IKeyedServiceProvider`](https://github.com/Tyrrrz/CliFx/issues/148). + ### Testing Thanks to the `IConsole` abstraction, **CliFx** commands can be easily tested in isolation. From 36b2b07a1de1021204073f7f156b1d95098f1dbc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 Nov 2024 00:46:43 +0200 Subject: [PATCH 6/7] Bump the nuget group with 7 updates (#149) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj | 8 ++++---- CliFx.Demo/CliFx.Demo.csproj | 2 +- CliFx.Tests/CliFx.Tests.csproj | 14 +++++++------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj b/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj index e8c7ce8..e66783b 100644 --- a/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj +++ b/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj @@ -11,12 +11,12 @@ - + - - + + - + diff --git a/CliFx.Demo/CliFx.Demo.csproj b/CliFx.Demo/CliFx.Demo.csproj index 67eeaac..32c0353 100644 --- a/CliFx.Demo/CliFx.Demo.csproj +++ b/CliFx.Demo/CliFx.Demo.csproj @@ -8,7 +8,7 @@ - + diff --git a/CliFx.Tests/CliFx.Tests.csproj b/CliFx.Tests/CliFx.Tests.csproj index 2883351..ffd59a4 100644 --- a/CliFx.Tests/CliFx.Tests.csproj +++ b/CliFx.Tests/CliFx.Tests.csproj @@ -10,16 +10,16 @@ - + - - + + - - - - + + + + From f5ff6193e8388c73982fe15fbe41f20e907eeba5 Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Tue, 12 Nov 2024 22:38:15 +0200 Subject: [PATCH 7/7] Use .NET 9 --- .github/workflows/main.yml | 2 +- CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj | 2 +- CliFx.Benchmarks/CliFx.Benchmarks.csproj | 2 +- CliFx.Demo/CliFx.Demo.csproj | 2 +- CliFx.Tests.Dummy/CliFx.Tests.Dummy.csproj | 2 +- CliFx.Tests/CliFx.Tests.csproj | 2 +- CliFx.Tests/Utils/Extensions/AssertionExtensions.cs | 5 +---- CliFx/Utils/Disposable.cs | 5 +---- 8 files changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6843bd6..dd8a748 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: with: deploy: ${{ inputs.deploy || github.ref_type == 'tag' }} package-version: ${{ inputs.package-version || (github.ref_type == 'tag' && github.ref_name) || format('0.0.0-ci-{0}', github.sha) }} - dotnet-version: 8.0.x + dotnet-version: 9.0.x secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} diff --git a/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj b/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj index e66783b..95a44fa 100644 --- a/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj +++ b/CliFx.Analyzers.Tests/CliFx.Analyzers.Tests.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 diff --git a/CliFx.Benchmarks/CliFx.Benchmarks.csproj b/CliFx.Benchmarks/CliFx.Benchmarks.csproj index cd9c097..eeb6a8e 100644 --- a/CliFx.Benchmarks/CliFx.Benchmarks.csproj +++ b/CliFx.Benchmarks/CliFx.Benchmarks.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/CliFx.Demo/CliFx.Demo.csproj b/CliFx.Demo/CliFx.Demo.csproj index 32c0353..3bed090 100644 --- a/CliFx.Demo/CliFx.Demo.csproj +++ b/CliFx.Demo/CliFx.Demo.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 ../favicon.ico diff --git a/CliFx.Tests.Dummy/CliFx.Tests.Dummy.csproj b/CliFx.Tests.Dummy/CliFx.Tests.Dummy.csproj index 849e0d0..1cdb598 100644 --- a/CliFx.Tests.Dummy/CliFx.Tests.Dummy.csproj +++ b/CliFx.Tests.Dummy/CliFx.Tests.Dummy.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 ../favicon.ico diff --git a/CliFx.Tests/CliFx.Tests.csproj b/CliFx.Tests/CliFx.Tests.csproj index ffd59a4..11b0c3b 100644 --- a/CliFx.Tests/CliFx.Tests.csproj +++ b/CliFx.Tests/CliFx.Tests.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/CliFx.Tests/Utils/Extensions/AssertionExtensions.cs b/CliFx.Tests/Utils/Extensions/AssertionExtensions.cs index f4f03a9..8ef3fd4 100644 --- a/CliFx.Tests/Utils/Extensions/AssertionExtensions.cs +++ b/CliFx.Tests/Utils/Extensions/AssertionExtensions.cs @@ -10,16 +10,13 @@ internal static class AssertionExtensions { public static void ConsistOfLines( this StringAssertions assertions, - IEnumerable lines + params IEnumerable lines ) => assertions .Subject.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries) .Should() .Equal(lines); - public static void ConsistOfLines(this StringAssertions assertions, params string[] lines) => - assertions.ConsistOfLines((IEnumerable)lines); - public static AndConstraint ContainAllInOrder( this StringAssertions assertions, IEnumerable values diff --git a/CliFx/Utils/Disposable.cs b/CliFx/Utils/Disposable.cs index 1050540..02484b4 100644 --- a/CliFx/Utils/Disposable.cs +++ b/CliFx/Utils/Disposable.cs @@ -12,13 +12,10 @@ internal partial class Disposable { public static IDisposable Create(Action dispose) => new Disposable(dispose); - public static IDisposable Merge(IEnumerable disposables) => + public static IDisposable Merge(params IEnumerable disposables) => Create(() => { foreach (var disposable in disposables) disposable.Dispose(); }); - - public static IDisposable Merge(params IDisposable[] disposables) => - Merge((IEnumerable)disposables); }