github.com/Heebron/moby@v0.0.0-20221111184709-6eab4f55faf7/hack/validate/golangci-lint (about) 1 #!/usr/bin/env bash 2 set -e -o pipefail 3 4 SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 5 6 # CI platforms differ, so per-platform GOLANGCI_LINT_OPTS can be set 7 # from a platform-specific Dockerfile, otherwise let's just set 8 # (somewhat pessimistic) default of 10 minutes. 9 : "${GOLANGCI_LINT_OPTS=--timeout=10m}" 10 11 [ -n "${TESTDEBUG}" ] && set -x 12 13 # TODO find a way to share this code with hack/make.sh 14 if pkg-config 'libsystemd' 2> /dev/null; then 15 DOCKER_BUILDTAGS+=" journald" 16 fi 17 18 echo -e "\n\033[0;36mINFO\033[0m Start validation with golang-ci-lint" 19 20 # TODO use --out-format=junit-xml and store artifacts 21 # shellcheck disable=SC2086 22 GOGC=75 golangci-lint run \ 23 ${GOLANGCI_LINT_OPTS} \ 24 --print-resources-usage \ 25 --build-tags="${DOCKER_BUILDTAGS}" \ 26 --verbose \ 27 --config "${SCRIPTDIR}/golangci-lint.yml"