diff --git a/.husky/task-runner.json b/.husky/task-runner.json index 2321858..0312abb 100644 --- a/.husky/task-runner.json +++ b/.husky/task-runner.json @@ -12,13 +12,13 @@ "command": "dotnet", "args": ["husky", "exec", ".husky/csx/commit-lint.csx", "--args", "${args}"] }, - { - "name": "dotnet-format", - "command": "dotnet", - "group": "pre-commit", - "args": ["dotnet-format", "--include" , "${staged}"], - "include": ["**/*.cs"] - }, +// { +// "name": "dotnet-format", +// "command": "dotnet", +// "group": "pre-commit", +// "args": ["dotnet-format", "--include" , "${staged}"], +// "include": ["**/*.cs"] +// }, { "name": "update-version", "command": "dotnet", diff --git a/tests/HuskyIntegrationTests/Issue99Tests.cs b/tests/HuskyIntegrationTests/Issue99Tests.cs index a028e05..b51b8ff 100644 --- a/tests/HuskyIntegrationTests/Issue99Tests.cs +++ b/tests/HuskyIntegrationTests/Issue99Tests.cs @@ -8,22 +8,20 @@ namespace HuskyIntegrationTests; public class Issue99Tests(DockerFixture docker, ITestOutputHelper output) : IClassFixture { [Fact] -public async Task StagedFiles_ShouldPassToJbCleanup_WithASemicolonSeparator() -{ - // arrange - var c = await ArrangeContainer(); - - // add 4 c# files - for (var i = 2; i <= 4; i++) + public async Task StagedFiles_ShouldPassToJbCleanup_WithASemicolonSeparator() { - var csharpFile = + // arrange + var c = await ArrangeContainer(); + + // add 4 c# files + for (var i = 2; i <= 4; i++) + { + var csharpFile = $$""" - namespace TestProjectBase; - public class Class {{i } -} - {public static void TestMethod() { } -} -"""; + public class Class{{i}} { + public static void TestMethod() { } + } + """; await c.AddCsharpClass(csharpFile, $"Class{i}.cs"); } @@ -31,40 +29,40 @@ public class Class {{i } await c.BashAsync("git add ."); // act -var result = await c.BashAsync(output, "git commit -m 'add 4 new csharp classes'"); + var result = await c.BashAsync(output, "git commit -m 'add 4 new csharp classes'"); // assert -result.ExitCode.Should().Be(0); -result.Stderr.Should().Contain(Extensions.SuccessfullyExecuted); + result.ExitCode.Should().Be(0); + result.Stderr.Should().Contain(Extensions.SuccessfullyExecuted); } [Fact] -public async Task StagedFiles_ShouldSkip_WhenNoMatchFilesFound() -{ - // arrange - var c = await ArrangeContainer(); - await c.BashAsync("git add ."); + public async Task StagedFiles_ShouldSkip_WhenNoMatchFilesFound() + { + // arrange + var c = await ArrangeContainer(); + await c.BashAsync("git add ."); - // act - var result = await c.BashAsync(output, "git commit -m 'add task-runner.json'"); + // act + var result = await c.BashAsync(output, "git commit -m 'add task-runner.json'"); - // assert - result.ExitCode.Should().Be(0); - result.Stderr.Should().Contain(Extensions.Skipped); -} + // assert + result.ExitCode.Should().Be(0); + result.Stderr.Should().Contain(Extensions.Skipped); + } -private async Task ArrangeContainer([CallerMemberName] string name = null!) -{ - var c = await docker.StartWithInstalledHusky(name); - await c.BashAsync("dotnet tool install JetBrains.ReSharper.GlobalTools"); - await c.BashAsync("dotnet tool restore"); - await c.BashAsync("git add ."); - await c.BashAsync("git commit -m 'add jb tool'"); + private async Task ArrangeContainer([CallerMemberName] string name = null!) + { + var c = await docker.StartWithInstalledHusky(name); + await c.BashAsync("dotnet tool install JetBrains.ReSharper.GlobalTools"); + await c.BashAsync("dotnet tool restore"); + await c.BashAsync("git add ."); + await c.BashAsync("git commit -m 'add jb tool'"); - const string tasks = - """ + const string tasks = + """ { - "tasks": [ + "tasks": [ { "name": "jb cleanup", "group": "pre-commit", @@ -82,7 +80,7 @@ private async Task ArrangeContainer([CallerMemberName] string name = } """; await c.UpdateTaskRunner(tasks); -await c.BashAsync("dotnet husky add pre-commit -c 'dotnet husky run -g pre-commit'"); -return c; + await c.BashAsync("dotnet husky add pre-commit -c 'dotnet husky run -g pre-commit'"); + return c; } }