Skip to content

Don't load and analyze dirs from --skip-dirs #301

Closed
@nicksnyder

Description

@nicksnyder

I am trying to run golangci-lint on sourcegraph/sourcegraph but it is failing due to the presence of some Go code in one of our node_modules dependencies (weird but ¯\_(ツ)_/¯). I tried using --skip-dirs node_modules, but it seems to not have any effect.

Reproduce:

git clone https://github.com/sourcegraph/sourcegraph
cd sourcegraph
yarn
golangci-lint -v run --skip-dirs node_modules

Requested info:

  1. Version of golangci-lint: golangci-lint --version (or git commit if you don't use binary distribution)
    55a18ae

  2. Config file: cat .golangci.yml
    None

  3. Go environment: go version && go env

go version go1.11.2 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/nick/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/nick/dev/gopath"
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=""
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/l6/djg_zw1j5lgbwz4h5q92lnwr0000gn/T/go-build800779018=/tmp/go-build -gno-record-gcc-switches -fno-common"
  1. Verbose output of running: golangci-lint run -v
$ golangci-lint -v run --skip-dirs node_modules
INFO [config_reader] Config search paths: [./ /Users/nick/dev/sourcegraph/node_modules /Users/nick/dev/sourcegraph /Users/nick/dev /Users/nick /Users /]
INFO Gocritic enabled checks: [appendAssign assignOp caseOrder dupArg dupBranchBody dupCase flagDeref ifElseChain regexpMust singleCaseSwitch sloppyLen switchTrue typeSwitchVar underef unlambda unslice defaultCaseOrder]
INFO [lintersdb] Active 8 linters: [deadcode errcheck govet ineffassign megacheck structcheck typecheck varcheck]
INFO [loader] Go packages loading at mode load deps types and syntax took 3.037896104s
ERRO Running error: context loading failed: failed to load program with go/packages: go [list -e -json -compiled -test=true -export=false -deps=true -- ./...]: exit status 1: build github.com/sourcegraph/sourcegraph/node_modules/snyk-go-plugin/gosrc: cannot find module for path _/Users/nick/dev/sourcegraph/node_modules/snyk-go-plugin/gosrc/resolver

INFO Memory: 32 samples, avg is 69.2MB, max is 69.2MB
INFO Execution took 3.13999768s

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvementstaleNo recent correspondence or work activity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions