github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/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 >= 209' 2> /dev/null; then 15 DOCKER_BUILDTAGS+=" journald" 16 elif ${PKG_CONFIG} 'libsystemd-journal' 2> /dev/null; then 17 DOCKER_BUILDTAGS+=" journald journald_compat" 18 fi 19 20 echo -e "\n\033[0;36mINFO\033[0m Start validation with golang-ci-lint" 21 22 # TODO use --out-format=junit-xml and store artifacts 23 # shellcheck disable=SC2086 24 GOGC=75 golangci-lint run \ 25 ${GOLANGCI_LINT_OPTS} \ 26 --print-resources-usage \ 27 --build-tags="${DOCKER_BUILDTAGS}" \ 28 --verbose \ 29 --config "${SCRIPTDIR}/golangci-lint.yml"