Skip to content

Commit 7998645

Browse files
committed
Configure swag fmt
1 parent 0e84dae commit 7998645

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.pre-commit-hooks.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
- id: swag-fmt
2+
name: swag-fmt
3+
entry: run-swag-fmt.sh
4+
language: script
5+
always_run: false
6+
fail_fast: false
7+
verbose: false
8+
description: 'Run swag fmt to format Swaggo comments in your code'
9+
args: []

run-swag-fmt.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
if ! which swag &> /dev/null
4+
then
5+
echo "swag could not be found. Please ensure it is installed and available on your PATH."
6+
exit 1
7+
fi
8+
9+
swag fmt $@

0 commit comments

Comments
 (0)