-
Welcome
Description of the problemThe utility is not able to run with any particular linter specified through the corresponding flags. Even the example on the website (last example on this page) leads to a similar result. Version of golangci-lint$ golangci-lint --version
golangci-lint has version 1.43.0 built from 861262b on 2021-11-08T08:59:38Z Configuration file$ cat .golangci.yaml
---
run:
issues-exit-code: 0
output:
sort-results: true
linters-settings:
lll:
tab-width: 8
gci:
local-prefixes: playground
linters:
enable-all: true
# TODO(toby3d): enable later after patch:
# https://github.com/golangci/golangci-lint/issues/1490
disable:
- gci Go environment$ go version && go env
go version go1.17.3 linux/amd64
GO111MODULE="on"
GOARCH="amd64"
GOBIN="/home/mmlebedev/go/bin"
GOCACHE="/home/mmlebedev/.cache/go-build"
GOENV="/home/mmlebedev/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/mmlebedev/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/mmlebedev/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,https://goproxy.io,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.17.3"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/mmlebedev/go/src/gitlab.com/toby3d/playground/go.mod"
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-build3580250=/tmp/go-build -gno-record-gcc-switches" Verbose output of running$ golangci-lint cache clean
$ golangci-lint run -v --disable-all --enable=lll
INFO [config_reader] Config search paths: [./ /home/mmlebedev/go/src/gitlab.com/toby3d/playground /home/mmlebedev/go/src/gitlab.com/toby3d /home/mmlebedev/go/src/gitlab.com /home/mmlebedev/go/src /home/mmlebedev/go /home/mmlebedev /home /]
INFO [config_reader] Used config file .golangci.yaml
ERRO Running error: --enable-all and --disable-all options must not be combined
INFO Memory: 2 samples, avg is 48.8MB, max is 48.8MB
INFO Execution took 2.368395ms After commenting $ golangci-lint cache clean
$ golangci-lint run -v --disable-all --enable=lll
INFO [config_reader] Config search paths: [./ /home/mmlebedev/go/src/gitlab.com/toby3d/playground /home/mmlebedev/go/src/gitlab.com/toby3d /home/mmlebedev/go/src/gitlab.com /home/mmlebedev/go/src /home/mmlebedev/go /home/mmlebedev /home /]
INFO [config_reader] Used config file .golangci.yaml
ERRO Running error: can't combine options --disable-all and --disable gci
INFO Memory: 2 samples, avg is 44.6MB, max is 44.6MB
INFO Execution took 2.190457ms Code example or link to a public repositoryThe error does not depend on the repository source code. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I think the output from your run is pretty clear:
Your configuration enables all linters and you're trying to disable all with the flags. To only run one linter, run without your configuration file: golangci-lint run -v --no-config --disable-all --enable lll |
Beta Was this translation helpful? Give feedback.
I think the output from your run is pretty clear:
Your configuration enables all linters and you're trying to disable all with the flags. To only run one linter, run without your configuration file: