From 596f04eae88488cf444118880993d74fd049ae18 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Thu, 4 Nov 2021 09:50:11 +0100 Subject: [PATCH] chore: update linter --- .github/workflows/validate.yaml | 2 +- .golangci.toml | 4 ++++ .semaphore/semaphore.yml | 2 +- build.Dockerfile | 2 +- pkg/middlewares/accesslog/logger_formatters_test.go | 3 +-- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index da4009c91..900c1d936 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -7,7 +7,7 @@ on: env: GO_VERSION: 1.17 - GOLANGCI_LINT_VERSION: v1.42.1 + GOLANGCI_LINT_VERSION: v1.43.0 MISSSPELL_VERSION: v0.3.4 PRE_TARGET: "" diff --git a/.golangci.toml b/.golangci.toml index 9caed7360..904ed4446 100644 --- a/.golangci.toml +++ b/.golangci.toml @@ -96,6 +96,10 @@ "godox", # Too strict "forcetypeassert", # Too strict "tagliatelle", # Not compatible with current tags. + "varnamelen", # not relevant + "nilnil", # not relevant + "ireturn", # not relevant + "contextcheck", # too many false-positive ] [issues] diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 30d7cd1f5..8e10e8da9 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -25,7 +25,7 @@ global_job_config: - export "PATH=${GOPATH}/bin:${PATH}" - mkdir -vp "${SEMAPHORE_GIT_DIR}" "${GOPATH}/bin" - export GOPROXY=https://proxy.golang.org,direct - - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${GOPATH}/bin" v1.42.1 + - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${GOPATH}/bin" v1.43.0 - curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | bash -s -- -b "${GOPATH}/bin" - go install github.com/containous/go-bindata/go-bindata@v1.0.0 - checkout diff --git a/build.Dockerfile b/build.Dockerfile index 30cc0056f..1ca6789ee 100644 --- a/build.Dockerfile +++ b/build.Dockerfile @@ -19,7 +19,7 @@ RUN mkdir -p /usr/local/bin \ && chmod +x /usr/local/bin/go-bindata # Download golangci-lint binary to bin folder in $GOPATH -RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.42.1 +RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.43.0 # Download misspell binary to bin folder in $GOPATH RUN curl -sfL https://raw.githubusercontent.com/client9/misspell/master/install-misspell.sh | bash -s -- -b $GOPATH/bin v0.3.4 diff --git a/pkg/middlewares/accesslog/logger_formatters_test.go b/pkg/middlewares/accesslog/logger_formatters_test.go index 1a7f69b5a..74a86b2a4 100644 --- a/pkg/middlewares/accesslog/logger_formatters_test.go +++ b/pkg/middlewares/accesslog/logger_formatters_test.go @@ -2,7 +2,6 @@ package accesslog import ( "net/http" - "os" "testing" "time" @@ -84,7 +83,7 @@ func TestCommonLogFormatter_Format(t *testing.T) { } // Set timezone to Etc/GMT+9 to have a constant behavior - os.Setenv("TZ", "Etc/GMT+9") + t.Setenv("TZ", "Etc/GMT+9") for _, test := range testCases { test := test