File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 77 language : ' script'
88 description : " Runs `gofmt`. Requires golang: https://go.dev/doc/install"
99 pass_filenames : true
10+ - id : go-fumpt
11+ name : ' gofumpt'
12+ entry : pre-commit-hooks/go-fumpt.sh
13+ types : [go]
14+ exclude : ' (^|/)vendor/'
15+ language : ' script'
16+ description : " Runs `gofumpt`. Requires gofumpt: https://github.com/mvdan/gofumpt" # yamllint disable-line rule:line-length
17+ pass_filenames : true
1018- id : go-imports
1119 name : ' goimports'
1220 entry : pre-commit-hooks/go-imports.sh
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # vi: ts=2:sw=2:et
3+ # vim: ft=bash
4+
5+ set -euo pipefail
6+
7+ if ! command -v gofumpt & > /dev/null
8+ then
9+ echo " gofumpt is not installed or is not in the current PATH" >&2
10+ echo " Find out more at: https://github.com/mvdan/gofumpt" >&2
11+ exit 1
12+ fi
13+
14+ output=" $( gofumpt -l -w " $@ " ) "
15+ echo " ${output} "
16+ [[ -z " ${output} " ]]
You can’t perform that action at this time.
0 commit comments