From dc3d76ea90baaa8a14d6cfa9e5778564f8804b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kowalik?= Date: Sat, 2 Mar 2024 23:35:59 +0100 Subject: [PATCH] added git hooks --- .config/dotnet-tools.json | 12 ++++++++++++ .husky/pre-commit | 24 ++++++++++++++++++++++++ .husky/task-runner.json | 13 +++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 .config/dotnet-tools.json create mode 100755 .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..32b3fc3 --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "husky": { + "version": "0.6.4", + "commands": [ + "husky" + ] + } + } +} \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..c302c02 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,24 @@ +#!/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 clean +dotnet build +dotnet format --verify-no-changes diff --git a/.husky/task-runner.json b/.husky/task-runner.json new file mode 100644 index 0000000..2a016c4 --- /dev/null +++ b/.husky/task-runner.json @@ -0,0 +1,13 @@ +{ + "tasks": [ + { + "name": "welcome-message-example", + "command": "bash", + "args": [ "-c", "echo Husky.Net is awesome!" ], + "windows": { + "command": "cmd", + "args": ["/c", "echo Husky.Net is awesome!" ] + } + } + ] +}