diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000..d2497dd --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "husky": { + "version": "0.7.1", + "commands": [ + "husky" + ] + } + } +} \ 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..fffa434 --- /dev/null +++ b/.husky/task-runner.json @@ -0,0 +1,10 @@ +{ + "tasks": [ + { + "name": "dotnet-format-staged-files", + "command": "dotnet", + "args": ["format", "src/Microsoft.Unity.Analyzers.sln", "whitespace", "--verbosity", "quiet", "--include", "${staged}"], + "include": ["**/*.cs"] + } + ] +} \ No newline at end of file diff --git a/src/Microsoft.Unity.Analyzers/Microsoft.Unity.Analyzers.csproj b/src/Microsoft.Unity.Analyzers/Microsoft.Unity.Analyzers.csproj index 75fce9b..d895a61 100644 --- a/src/Microsoft.Unity.Analyzers/Microsoft.Unity.Analyzers.csproj +++ b/src/Microsoft.Unity.Analyzers/Microsoft.Unity.Analyzers.csproj @@ -28,4 +28,9 @@ + + + + +