golangci-lint 817 B

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