Skip to content

Commit

Permalink
Install Husky.Net
Browse files Browse the repository at this point in the history
  • Loading branch information
wjrogers committed Jan 19, 2024
1 parent 27204e6 commit 9e63faa
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
"commands": [
"nbgv"
]
},
"husky": {
"version": "0.6.4",
"commands": [
"husky"
]
}
}
}
}
22 changes: 22 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions .husky/task-runner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"tasks": [
{
"name": "dotnet-format",
"group": "pre-commit",
"command": "dotnet",
"args": [ "format", "--include", "${staged}" ],
"include": [ "**/*.cs" ]
}
]
}

0 comments on commit 9e63faa

Please sign in to comment.