1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2024-11-24 08:12:38 +02:00
imgproxy/.lefthook/pre-commit/lint
2023-11-25 20:42:54 +03:00

17 lines
426 B
Bash
Executable File

#!/bin/sh
if ! git diff --staged --name-only | grep -qE ".*\.go$|\.golangci\.yml$"; then
echo "Nothing to lint"
exit 0;
fi
if [ -x "$(which brew)" ]; then
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(brew --prefix libffi)/lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(brew --prefix libarchive)/lib/pkgconfig"
fi
export CGO_LDFLAGS_ALLOW="-s|-w"
export CGO_CFLAGS_ALLOW="-Xpreprocessor"
golangci-lint run