Skip to content

Commit

Permalink
Merge pull request #1816 from keboola/lint-add-linters
Browse files Browse the repository at this point in the history
lint: Add new linters without code change. Add new disabled linters.
  • Loading branch information
Matovidlo authored Nov 25, 2024
2 parents d09d394 + 73a56d0 commit b1ba99a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
23 changes: 22 additions & 1 deletion build/ci/golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -135,9 +141,11 @@ linters:
- goheader
- gomodguard
- goprintffuncname
- gosmopolitan
- gosec
- gosimple
- govet
- grouper
- importas
- inamedparam
- ineffassign
Expand All @@ -150,12 +158,14 @@ linters:
- prealloc
- predeclared
- promlinter
- reassign
- rowserrcheck
- sqlclosecheck
- staticcheck
- stylecheck
- tagliatelle
- testifylint
- tenv
- thelper
- tparallel
- paralleltest
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b1ba99a

Please sign in to comment.