mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #93 from lavalamp/improve_hooks
Improved commit hook
This commit is contained in:
commit
da92ba3246
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
errors=0
|
errors=0
|
||||||
for file in $(git diff --cached --name-only | grep "\.go"); do
|
for file in $(git diff --cached --name-only | grep "\.go"); do
|
||||||
diff="$(gofmt -d "${file}")"
|
diff="$(git show ":${file}" | gofmt -d)"
|
||||||
if [[ -n "$diff" ]]; then
|
if [[ -n "$diff" ]]; then
|
||||||
echo "# *** ERROR: *** File ${file} has not been gofmt'd." >> $1
|
echo "# *** ERROR: *** File ${file} has not been gofmt'd." >> $1
|
||||||
errors=1
|
errors=1
|
||||||
|
Loading…
Reference in New Issue
Block a user