Skip to content

Commit

Permalink
bump golangci-lint v1.20.0
Browse files Browse the repository at this point in the history
release notes:

- v1.20.0: https://github.com/golangci/golangci-lint/releases/tag/v1.20.0
    - Add WSL linter (#771)
    - Add gocognit linter (#756)
    - govet: add more analyzers
    - dramatically reduce memory usage
    - reduce 1.5x memory usage on large repos on repeated runs
    - Rename deadline option to timeout and mark deadline as deprecated
- v1.19.1: https://github.com/golangci/golangci-lint/releases/tag/v1.19.1
- v1.19.0: https://github.com/golangci/golangci-lint/releases/tag/v1.19.0
    - Add dogsled linter.
    - Add whitespace linter
    - Add Godox linter support
    - Various performance optimizations
- v1.18.0: https://github.com/golangci/golangci-lint/releases/tag/v1.18.0
    - Support go1.13
    - Update format of junit xml output to mark failures as such
    - Speed up linting: use deduplicated packages
    - Add user supplied error messages in depguard issues
    - Add funlen linter

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Oct 17, 2019
1 parent a06d7f5 commit 9cb9c6e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
12 changes: 10 additions & 2 deletions hack/dockerfile/install/golangci_lint.installer
@@ -1,11 +1,19 @@
#!/bin/sh

: "${GOLANGCI_LINT_COMMIT=v1.17.1}"
: "${GOLANGCI_LINT_COMMIT=v1.20.0}"

install_golangci_lint() {
echo "Installing golangci-lint version ${GOLANGCI_LINT_COMMIT}"
go get -d github.com/golangci/golangci-lint/cmd/golangci-lint
cd "$GOPATH/src/github.com/golangci/golangci-lint/" || exit 1
git checkout -q "${GOLANGCI_LINT_COMMIT}"
go build -buildmode=pie -o "${PREFIX}/golangci-lint" "github.com/golangci/golangci-lint/cmd/golangci-lint"

version="$(git describe --tags)"
commit="$(git rev-parse --short HEAD)"
commitDate="$(git show -s --format=%cd)"

go build \
-buildmode=pie \
-ldflags "-s -w -X \"main.version=${version}\" -X \"main.commit=${commit}\" -X \"main.date=${commitDate}\"" \
-o "${PREFIX}/golangci-lint" "github.com/golangci/golangci-lint/cmd/golangci-lint"
}
7 changes: 4 additions & 3 deletions hack/validate/golangci-lint
Expand Up @@ -6,7 +6,7 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# CI platforms differ, so per-platform GOLANGCI_LINT_OPTS can be set
# from a platform-specific Dockerfile, otherwise let's just set
# (somewhat pessimistic) default of 10 minutes.
: ${GOLANGCI_LINT_OPTS=--deadline=20m}
: "${GOLANGCI_LINT_OPTS=--timeout=10m}"

[ -n "${TESTDEBUG}" ] && set -x

Expand All @@ -18,9 +18,10 @@ elif ${PKG_CONFIG} 'libsystemd-journal' 2> /dev/null ; then
fi

# TODO use --out-format=junit-xml and store artifacts
GOGC=20 golangci-lint run \
# shellcheck disable=SC2086
GOGC=75 golangci-lint run \
${GOLANGCI_LINT_OPTS} \
--print-resources-usage \
--build-tags="${DOCKER_BUILDTAGS}" \
--verbose \
--config ${SCRIPTDIR}/golangci-lint.yml
--config "${SCRIPTDIR}/golangci-lint.yml"

0 comments on commit 9cb9c6e

Please sign in to comment.