Skip to content

Unable to run a specific linter #2399

@toby3d

Description

@toby3d

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

The 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

Details
$ golangci-lint --version
golangci-lint has version 1.43.0 built from 861262b on 2021-11-08T08:59:38Z

Configuration file

Details
$ 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

Details
$ 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

Details
$ 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 enable-all: true line in config:

Details
$ 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 repository

The error does not depend on the repository source code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions