From 0bd288cc7231299e9f3717267149c40c33b6c5bf Mon Sep 17 00:00:00 2001 From: Pavel Simsa Date: Tue, 22 Oct 2024 14:16:37 +0200 Subject: [PATCH] Bootstrap husky --- .config/dotnet-tools.json | 13 +++++++++++++ .husky/pre-commit | 22 ++++++++++++++++++++++ .husky/task-runner.json | 11 +++++++++++ build/_build.csproj | 12 ++++++------ 4 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 .config/dotnet-tools.json create mode 100644 .husky/pre-commit create mode 100644 .husky/task-runner.json diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000..e6df774 --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,13 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "husky": { + "version": "0.7.1", + "commands": [ + "husky" + ], + "rollForward": false + } + } +} \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..fd85d23 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,22 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +## husky task runner examples ------------------- +## Note : for local installation use 'dotnet' prefix. e.g. 'dotnet husky' + +## run all tasks +#husky run + +### run all tasks with group: 'group-name' +#husky run --group group-name + +## run task with name: 'task-name' +#husky run --name task-name + +## pass hook arguments to task +#husky run --args "$1" "$2" + +## or put your custom commands ------------------- +#echo 'Husky.Net is awesome!' + +dotnet husky run diff --git a/.husky/task-runner.json b/.husky/task-runner.json new file mode 100644 index 0000000..a6f9f08 --- /dev/null +++ b/.husky/task-runner.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://alirezanet.github.io/Husky.Net/schema.json", + "tasks": [ + { + "name": "Run csharpier", + "command": "dotnet", + "args": [ "csharpier", "${staged}" ], + "include": [ "**/*.cs" ] + } + ] +} diff --git a/build/_build.csproj b/build/_build.csproj index 0546a42..ada4056 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -1,5 +1,4 @@ - - + Exe net8.0 @@ -9,14 +8,15 @@ .. 1 - - - - + + + + + \ No newline at end of file