From d6f98c2d2c17828edf4422557f73e3b419376932 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Thu, 14 Nov 2024 15:45:39 +0100 Subject: [PATCH] chore: update linter --- .github/workflows/pr.yml | 2 +- .golangci.yml | 84 ++++++++++++++++++++-------------------- 2 files changed, 42 insertions(+), 44 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b48bfaf..37bb2e6 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest env: GO_VERSION: stable - GOLANGCI_LINT_VERSION: v1.61.0 + GOLANGCI_LINT_VERSION: v1.62.0 steps: - uses: actions/checkout@v4 diff --git a/.golangci.yml b/.golangci.yml index f9ffc57..dd6fb31 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,34 @@ -run: - timeout: 5m +linters: + enable-all: true + disable: + - exportloopref # deprecated + - sqlclosecheck # not relevant (SQL) + - rowserrcheck # not relevant (SQL) + - cyclop # duplicate of gocyclo + - lll + - dupl + - wsl + - nlreturn + - mnd + - err113 + - wrapcheck + - exhaustive + - exhaustruct + - testpackage + - tparallel + - paralleltest + - prealloc + - forcetypeassert + - bodyclose # Too many false positives: https://github.com/timakin/bodyclose/issues/30 + - varnamelen + - noctx + - tagliatelle + - nilnil + - ireturn + - nonamedreturns + - gochecknoglobals # TODO(ldez) should be use on the project + - nestif # TODO(ldez) should be use on the project + - musttag linters-settings: govet: @@ -55,47 +84,6 @@ linters-settings: sprintf1: true strconcat: false -linters: - enable-all: true - disable: - - gomnd # deprecated - - execinquery # deprecated - - exportloopref # deprecated - - sqlclosecheck # not relevant (SQL) - - rowserrcheck # not relevant (SQL) - - cyclop # duplicate of gocyclo - - lll - - dupl - - wsl - - nlreturn - - mnd - - err113 - - wrapcheck - - exhaustive - - exhaustruct - - testpackage - - tparallel - - paralleltest - - prealloc - - forcetypeassert - - bodyclose # Too many false positives: https://github.com/timakin/bodyclose/issues/30 - - varnamelen - - noctx - - tagliatelle - - nilnil - - ireturn - - nonamedreturns - - gochecknoglobals # TODO(ldez) should be use on the project - - nestif # TODO(ldez) should be use on the project - - musttag - -output: - show-stats: true - sort-results: true - sort-order: - - linter - - file - issues: exclude-use-default: false max-issues-per-linter: 0 @@ -137,3 +125,13 @@ issues: text: "float-compare: use assert\\.InEpsilon \\(or InDelta\\)" # TODO(ldez) must be fixed - path: memmetrics/anomaly_test.go text: "float-compare: use assert\\.InEpsilon \\(or InDelta\\)" # TODO(ldez) must be fixed + +output: + show-stats: true + sort-results: true + sort-order: + - linter + - file + +run: + timeout: 5m