From 261ba3f9f2638c8b6428417141f5fdc1cbd0a148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Va=C5=A1ko?= Date: Tue, 4 Jun 2024 10:46:51 +0200 Subject: [PATCH 1/2] lint: Add new linters without code change. Add new disabled linters. --- build/ci/golangci.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/build/ci/golangci.yml b/build/ci/golangci.yml index 2488960b88..95f227a378 100644 --- a/build/ci/golangci.yml +++ b/build/ci/golangci.yml @@ -112,21 +112,27 @@ linters: disable-all: true enable: - asciicheck + - bidichk - bodyclose - contextcheck + - decorder - depguard - dogsled - dupl - durationcheck - errcheck + - errchkjson - errname - errorlint - exhaustive - copyloopvar - forbidigo - gci + - ginkgolinter + - gocheckcompilerdirectives - gochecknoglobals - #- gochecknoinits - temporary disabled https://github.com/golangci/golangci-lint/issues/4697 + - gochecknoinits + - gochecksumtype - goconst - gocritic - godot @@ -135,9 +141,11 @@ linters: - goheader - gomodguard - goprintffuncname + - gosmopolitan - gosec - gosimple - govet + - grouper - importas - inamedparam - ineffassign @@ -150,12 +158,14 @@ linters: - prealloc - predeclared - promlinter + - reassign - rowserrcheck - sqlclosecheck - staticcheck - stylecheck - tagliatelle - testifylint + - tenv - thelper - tparallel - paralleltest @@ -172,11 +182,22 @@ linters: #- gomoddirectives # allow replace directive in go.mod #- misspell - broken, rewrites code # TODO + #- canonicalheader # when enabled skip old headers from linting e.g X-StorageAPI-Token + #- containedctx + #- dupword + #- exhaustruct #- funlen + #- forcetypeassert #- gocyclo #- gocognit #- cyclop + #- maintidx + #- mnd #- nestif + #- nlreturn + #- nosprintfhostport + #- spancheck + #- testpackage #- lll #- gomnd From 73a56d082f3c1afbd1c22dc5a900d9db90f9b4b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Va=C5=A1ko?= Date: Fri, 22 Nov 2024 12:56:29 +0100 Subject: [PATCH 2/2] fix: Remove test assign of environment. Not possible when test run in parallel --- .../testtemplateinputs/testtemplateinputs_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/pkg/utils/testhelper/testtemplateinputs/testtemplateinputs_test.go b/internal/pkg/utils/testhelper/testtemplateinputs/testtemplateinputs_test.go index 663c49e0eb..1a48c371ad 100644 --- a/internal/pkg/utils/testhelper/testtemplateinputs/testtemplateinputs_test.go +++ b/internal/pkg/utils/testhelper/testtemplateinputs/testtemplateinputs_test.go @@ -12,9 +12,9 @@ import ( func TestNewUserErrorWithCode(t *testing.T) { t.Parallel() - require.NoError(t, os.Setenv("CUSTOM_ENV", "val1")) //nolint:forbidigo - require.NoError(t, os.Setenv("KBC_SECRET_VAR2", "val2")) //nolint:forbidigo - require.NoError(t, os.Setenv("KBC_SECRET_VAR3", "val3")) //nolint:forbidigo + require.NoError(t, os.Setenv("CUSTOM_ENV", "val1")) //nolint:forbidigo, tenv + require.NoError(t, os.Setenv("KBC_SECRET_VAR2", "val2")) //nolint:forbidigo, tenv + require.NoError(t, os.Setenv("KBC_SECRET_VAR3", "val3")) //nolint:forbidigo, tenv provider, err := CreateTestInputsEnvProvider(context.Background()) require.NoError(t, err)