Skip to content

gocyclo isn't run #722

Closed
Closed
@LennyPenny

Description

@LennyPenny

Thank you for creating the issue!

Version

golangci-lint has version v1.18.0 built from (unknown, mod sum: "h1:XmQgfcLofSG/6AsQuQqmLizB+3GggD+o6ObBG9L+VMM=") on (unknown)
  1. Config file:
linters:
  enable:
    - govet
    - errcheck
    - staticcheck
    - unused
    - gosimple
    - structcheck
    - varcheck
    - ineffassign
    - deadcode
    - typecheck
    - goconst
    - gofmt
    - goimports
    - gosec
    - gocyclo
linter-settings:
  gocyclo:
    min-complexity: 10
  1. Go environment:
$ go version && go env
go version go1.12.9 linux/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/lenny/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/lenny/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/golang"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/lenny/go/src/gitlab.com/fino/uba/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-build080054239=/tmp/go-build -gno-record-gcc-switches"

running gocyclo on its own results in results being shown, however running gocyclo through golangci-lint produces no output.

gocyclo output:

$ go run github.com/fzipp/gocyclo --over 10 xxx.go
19 handler yyy xxx.go:66:1
15 handler yyy xxx.go:314:1
15 handler yyy xxx.go:937:1
15 handler yyy xxx.go:673:1
13 handler yyy xxx.go:560:1
12 handler yyy xxx.go:1023:1
exit status 1

golangci-lint output:

$ ~/go/bin/golangci-lint run xxx.go -v
INFO [config_reader] Config search paths: [./ xxx /home/lenny/go/src/gitlab.com /home/lenny/go/src /home/lenny/go /home/lenny /home /] 
INFO [config_reader] Used config file .golangci.yml 
INFO [lintersdb] Active 15 linters: [deadcode errcheck goconst gocyclo gofmt goimports gosec gosimple govet ineffassign staticcheck structcheck typecheck unused varcheck] 
INFO [lintersdb] Optimized sublinters [staticcheck gosimple unused] into metalinter megacheck 
INFO [loader] Go packages loading at mode 991 (files|types_sizes|compiled_files|deps|types|types_info|imports|name|syntax) took 1.766214225s 
INFO [loader] SSA repr building timing: packages building 28.877015ms, total 308.18515ms 
INFO [runner] worker.4 took 1.536759ms with stages: deadcode: 736.627µs, structcheck: 468.443µs, goconst: 324.951µs 
INFO [runner] worker.8 took 1.928124ms with stages: varcheck: 1.05247ms, errcheck: 513.885µs, gocyclo: 346.077µs, typecheck: 2.515µs 
INFO [runner] worker.3 took 9.247182ms with stages: ineffassign: 9.238964ms 
INFO [runner] worker.1 took 10.98954ms with stages: gofmt: 10.98252ms 
xxx.go:777:30: Error return value of `yyy` is not checked (errcheck)
        yyy
                                    ^
INFO [runner] worker.2 took 52.407277ms with stages: goimports: 52.397205ms 
INFO [runner] worker.7 took 66.47593ms with stages: gosec: 66.466174ms 
INFO [runner] worker.6 took 175.513867ms with stages: govet: 175.501356ms 
INFO [runner] worker.5 took 899.517153ms with stages: megacheck: 899.510172ms 
INFO [runner] Workers idle times: #1: 888.495619ms, #2: 847.086282ms, #3: 890.188556ms, #4: 897.914577ms, #6: 723.967841ms, #7: 832.991121ms, #8: 897.538842ms 
INFO [runner] Issues before processing: 2, after processing: 1 
INFO [runner] processing took 21.742158ms with stages: autogenerated_exclude: 13.93719ms, nolint: 6.731718ms, source_code: 532.477µs, exclude: 252.718µs, identifier_marker: 150.613µs, skip_dirs: 49.274µs, uniq_by_line: 19.437µs, path_shortener: 14.452µs, cgo: 14.051µs, max_from_linter: 13.005µs, path_prettifier: 12.989µs, max_same_issues: 4.392µs, filename_unadjuster: 3.473µs, max_per_file_from_linter: 2.967µs, diff: 2.139µs, exclude-rules: 705ns, skip_files: 558ns 
INFO File cache stats: 1 entries of total size 38.4KiB 
INFO Memory: 30 samples, avg is 367.0MB, max is 743.8MB 
INFO Execution took 3.057199579s   

Expected output:
Same as gocyclo output

Metadata

Metadata

Assignees

No one assigned

    Labels

    feedback requiredRequires additional feedbackstaleNo 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