Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't define global config for gosec #2879

Closed
4 tasks done
maratori opened this issue May 26, 2022 · 0 comments · Fixed by #2880
Closed
4 tasks done

Can't define global config for gosec #2879

maratori opened this issue May 26, 2022 · 0 comments · Fixed by #2880
Labels
area: config Related to .golangci.yml and/or cli options bug Something isn't working

Comments

@maratori
Copy link
Contributor

Welcome

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).
  • Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)

Description of the problem

Gosec has a global section in config: https://github.com/securego/gosec/blob/12be14859bc7d4b956b71bef0b443694aa519d8a/config.go#L43

But golangci-lint doesn't allow to define it. Because it changes all map keys to capital letters:

conf.Set(strings.ToUpper(k), v)

Version of golangci-lint

$ golangci-lint --version
golangci-lint has version v1.46.2 built from (unknown, mod sum: "h1:o90t/Xa6dhJbvy8Bz2RpzUXqrkigp19DLStMolTZbyo=") on (unknown)

Configuration file

$ cat .golangci.yml
linters-settings:
  gosec:
    config:
      global:
        show-ignored: true
        audit: true

Go environment

$ go version && go env
go version go1.18 linux/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/go/pkg/mod"
GONOPROXY="github.com/gtforge"
GONOSUMDB="github.com/gtforge"
GOOS="linux"
GOPATH="/go"
GOPRIVATE="github.com/gtforge"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/app/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1284005871=/tmp/go-build -gno-record-gcc-switches"

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
# paste output here

Code example or link to a public repository

// add your code here
@maratori maratori added the bug Something isn't working label May 26, 2022
@ldez ldez added the area: config Related to .golangci.yml and/or cli options label May 29, 2022
@ldez ldez closed this as completed in #2880 Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: config Related to .golangci.yml and/or cli options bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants