Skip to content

Exclude doesn't work with filenames in the regexp #300

Closed
@schoentoon

Description

@schoentoon

I'm trying to exclude the global variable check on the cmd/ directory. I thought about using the exclude config for this, however cmd\/.+is a global variable regex doesn't seem to work for this as it only seems to match against the actual message from the linter and not the file/line number.

Please include the following information:

  1. Version of golangci-lint: golangci-lint --version
    golangci-lint has version 1.12 built from 7836034 on 2018-11-07T09:03:53Z
  2. Config file: cat .golangci.yml
[run]
tests = false

[linters]
enable-all = true
disable = ["typecheck", "goconst", "goimports"]

[issues]
exclude = [ 
  "cmd\/.+is a global variable"
]
  1. Go environment: go version && go env
go version go1.11.2 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/<user>/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/<user>/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/<user>/git/<project>/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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/qk/76c0lh7166nbz10bntlqwqw80000gn/T/go-build965110773=/tmp/go-build -gno-record-gcc-switches -fno-common"

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions