maeqtt/pre-commit.sh
2021-10-17 20:59:42 +02:00

17 lines
330 B
Bash
Executable file

#!/usr/bin/env bash
# stolen from somewhere idk where tho tbh
GOPATH="${GOPATH:-"$HOME/go"}"
PATH="$PATH:$GOPATH/bin/"
# Check for golangci-lint
if [[ ! "which golangci-lint 2>&1 > /dev/null" ]]; then
printf "\t\033[41mPlease install golangci-lint\033"
exit 1
fi
golangci-lint run --fix --new-from-rev HEAD ./...
exit 0