Skip to content

enable-all in config file can't be overridden on command line? #542

Closed
@sb10

Description

@sb10
  1. Version of golangci-lint: golangci-lint --version
    golangci-lint has version 1.16.0 built from 97ea1cb on 2019-03-31T19:48:46Z
  2. Config file: cat .golangci.yml
linters:
  enable-all: true
  disable-all: false
  disable:
    - depguard
    - dupl
    - gochecknoglobals
    - gochecknoinits
    - gocyclo
    - gofmt
    - lll
  1. Go environment: go version && go env
go version go1.12.5 linux/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/nfs/users/nfs_s/sb10/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/nfs/users/nfs_s/sb10/go"
GOPROXY=""
GORACE=""
GOROOT="/software/vertres/installs/go"
GOTMPDIR=""
GOTOOLDIR="/software/vertres/installs/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="0"
GOMOD="/nfs/users/nfs_s/sb10/src/go/github.com/VertebrateResequencing/wr/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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build378946545=/tmp/go-build"

When I run golangci-lint run (or for my text editor) I want all but a certain few linters to be enabled, so my config file has enable-all: true and certain linters in the disable section.

But sometimes I want to run just some of those disabled linters. I hope to be able to do this:

golangci-lint run --disable-all -E gocyclo -E dupl

But I can't:

ERRO Running error: --enable-all and --disable-all options must not be combined

Is there another way I can do what I want? How do you keep using a single config file (which may have per-linter options in it), but sometimes override to only run 1 or 2 specific linters?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: configRelated to .golangci.yml and/or cli optionsquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions