Giter Club home page Giter Club logo

golangci's Introduction

If you are looking for golangci-lint please go to https://github.com/golangci/golangci-lint

THIS REPOSITORY IS ARCHIVED.

GolangCI

GolangCI is an automated golang codereview tool.

This repository contains the central issue tracker for the GolangCI project.

Other repositories

GolangCI consists of sub-projects. The main ones are:

golangci-api

golangci-api is the Golang server with REST API for golangci-web.

golangci-web

golangci-web is a frontend of golangci.com. It uses React, Redux, Typescript, Webpack.

golib

golib is a small Golang HTTP framework. It's used in golangci-api.

golangci-worker

golangci-worker is the queue worker. When user creates or updates GitHub pull request, golangci-api gets webhook event about it. Then it send this event to distributed queue. golangci-worker handles such queue events and runs code analysis.

Issues, Features

Create issue in central issue tracker. Also you can create issue in one of subprojects repo if you know which one you need.

Contact email is [email protected].

golangci's People

Contributors

ldez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

golangci's Issues

no details link

Usually CI tools I've seen offer a Details link that shows a log of the tool's execution. This is handy to help debug issues.

Right now I'm not seeing anything to help debug #7 .

screen shot 2018-05-28 at 11 58 01 am

Visiting an unconnected repo's report URL causes internal server err

πŸ‘‹ Hi folks,

Thanks for the awesome project! It's already been a helpful addition to the CI pipeline on a few of my projects. 🍻 πŸ™‡β€β™‚οΈ

I noticed that if I directly visit the "Report" link for a project I haven't connected to GolangCI the system produces a HTTP Status Code 500 Server Internal Error response.

I can reproduce this reliably visiting https://golangci.com/r/github.com/letsencrypt/boulder. It also appears to fail the same way if you visit a report URL for a Github user that exists but a repository that doesn't, e.g. https://golangci.com/r/github.com/cpu/foobar

cgo compile fails with v1.16.0

Since v1.16.0 was released, my checks have been failing like this

Eg https://golangci.com/r/github.com/ncw/rclone/pulls/3101

analyze (1.0s)
$ GOLANGCI_COM_RUN=1 golangci-lint run --out-format=json --issues-exit-code=0 --deadline=5m --new=false --new-from-rev= --new-from-patch=../changes.patch
    Running error: context loading failed: failed to load program with go/packages: go [list -e -json -compiled -test=true -export=false -deps=true -find=false -tags cmount -- ./...]: exit status 2: # github.com/ncw/rclone/vendor/github.com/billziss-gh/cgofuse/fuse
    vendor/github.com/billziss-gh/cgofuse/fuse/host.go:39:18: fatal error: fuse.h: No such file or directory
     #include <fuse.h>
                      ^
    compilation terminated.

What appears to be happening is that it is trying to compile cgo code and failing because the FUSE library isn't installed.

This is guarded by a build tag cmount so isn't built normally.

I'm not sure how to fix this. It is certainly a regression since v1.15.0 worked just fine, but perhaps there is something I can do?

Thanks for a great tool

Shield Badges Scoring

Hi,

Thanks for releasing the support for private repos.

Is it possible to have a quick overview on the badge scoring (eg: How do you mark a repo as A+ or lower) ?

Regards

GitLab Support

Hi,

I was wondering if adding support for GitLab Go projects was part of the roadmap.

Cheers

golangci-lint 0.18 support

Seems currently golangci is not supporting the latest version. We rely on this change to support golang 1.13, so we were forced to upgrade but now we aren't getting the great PR feedback. Would be great for this to be supported as well.

Error messages are like Failed to setup workspace: goenvbuild internal error: setup golangci-lint failed: no available minor version 18, see build log

Analysis fails with imported packages - no Go Files in

Hi,

I'm facing similar issue described in #24 with no Go Files in errors for imported packages.

My workaround is to skip these directories in .golangci.yml file but I was wondering whether there is any better solution:

skip-dirs:
    - github.com/x-cray/logrus-prefixed-formatter
    - github.com/sirupsen/logrus
    - github.com/speps/go-hashids
    - github.com/shirou/gopsutil/disk
    - github.com/shirou/gopsutil/cpu
    - github.com/shirou/gopsutil/host
    - github.com/shirou/gopsutil/mem
    - github.com/jackc/pgx
    - github.com/appleboy/gin-jwt
    - github.com/docker/docker/api/types
    - github.com/docker/docker/api/types/container
    - github.com/docker/docker/api/types/mount
    - github.com/gin-gonic/gin
    - github.com/gin-gonic/gin/json
    - github.com/go-ini/ini
    - gopkg.in/dgrijalva/jwt-go.v3
    - github.com/docker/docker/client
    - github.com/swaggo/gin-swagger
    - github.com/swaggo/gin-swagger/swaggerFiles
    - github.com/alecthomas/template
    - github.com/swaggo/swag
    - vendor$

Thanks & Regards,

no comments/output on PR

Hi, I'm trying this out on a PR of mine: adamdecaf/cert-manage#195

The problem is I'm not seeing any output. If I run golangci-lint run locally I see some errors. I'm also seeing output if I disable/enable the checks as what's on the PR.

$ golangci-lint run --enable-all --disable golint,interfacer,gocyclo,gofmt,goimports,maligned,megacheck
Run this tool in cloud on every github pull request in https://golangci.com for free (public repos)
main.go:151:10: Error return value of `fs.Parse` is not checked (errcheck)
	fs.Parse(os.Args[1:])
	        ^
main.go:156:10: Error return value of `fs.Parse` is not checked (errcheck)
	fs.Parse(os.Args[2:]) // reparse
	        ^
pkg/certutil/x509.go:26:10: Error return value of `ss.Write` is not checked (errcheck)
	ss.Write(c.Raw)
	        ^
pkg/certutil/x509.go:32:10: Error return value of `ss.Write` is not checked (errcheck)
	ss.Write(c.Raw)
	        ^
pkg/cmd/gen_whitelist.go:144:9: Error return value of `w.Flush` is not checked (errcheck)
	w.Flush()
	       ^
pkg/ui/server/server.go:73:18: Error return value of `io.WriteString` is not checked (errcheck)
			io.WriteString(w, fmt.Sprintf("ERROR: %v", err))
			              ^
pkg/ui/web.go:83:17: Error return value of `io.WriteString` is not checked (errcheck)
		io.WriteString(w, fmt.Sprintf("ERROR: %v", err))
		              ^
pkg/ui/web.go:94:18: Error return value of `io.WriteString` is not checked (errcheck)
			io.WriteString(w, fmt.Sprintf("Unknown format %s", cfg.Format))
			              ^
pkg/ui/web.go:121:12: Error return value of `w1.Flush` is not checked (errcheck)
			w1.Flush()
			        ^
pkg/ui/web.go:128:8: Error return value of `write` is not checked (errcheck)
		write(w, list, struct {
		     ^
pkg/ui/web.go:133:8: Error return value of `write` is not checked (errcheck)
		write(w, footer, nil)
		     ^
test/main_test.go:31:20: unnecessary conversion (unconvert)
	fmt.Println(string(out))
	                  ^
pkg/whitelist/gen/firefox.go:48:31: unnecessary conversion (unconvert)
			VisistedAt: time.Unix(int64(when/1e6), 0).UTC(), // throw away nsec
			                           ^
pkg/whitelist/gen/gen.go:35:2: `client` is unused (varcheck)
	client = httputil.New()
	^

Internal error, out of memory

Example: https://golangci.com/r/github.com/istio/istio/pulls/13041

Please include the following information:

  1. Version of golangci-lint: 1.15.x
  2. Config file: https://github.com/istio/istio/blob/master/.golangci.yml
  3. Verbose output of running: See link above
$ GOLANGCI_COM_RUN=1 golangci-lint run --out-format=json --issues-exit-code=0 --deadline=5m --new=false --new-from-rev= --new-from-patch=../changes.patch
    fatal error: runtime: out of memory
    
    runtime stack:
    runtime.throw(0xe79fc5, 0x16)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/runtime/panic.go:617 +0x72
    runtime.sysMap(0xc364000000, 0x4000000, 0x17fd0b8)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/runtime/mem_linux.go:170 +0xc7
    runtime.(*mheap).sysAlloc(0x17dec20, 0x2000, 0x17dec30, 0x1)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/runtime/malloc.go:633 +0x1cd
    runtime.(*mheap).grow(0x17dec20, 0x1, 0x0)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/runtime/mheap.go:1232 +0x42
    runtime.(*mheap).allocSpanLocked(0x17dec20, 0x1, 0x17fd0c8, 0x7f3037830fc8)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/runtime/mheap.go:1150 +0x3a7
    runtime.(*mheap).alloc_m(0x17dec20, 0x1, 0x7ffc7cd0003e, 0x7f3037830fc8)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/runtime/mheap.go:977 +0xc2
    runtime.(*mheap).alloc.func1()
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/runtime/mheap.go:1048 +0x4c
    runtime.systemstack(0x4591c9)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/runtime/asm_amd64.s:351 +0x66
    runtime.mstart()
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/runtime/proc.go:1153
    
    goroutine 24965 [running]:
    runtime.systemstack_switch()
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/runtime/asm_amd64.s:311 fp=0xc0e95a71a0 sp=0xc0e95a7198 pc=0x4592c0
    runtime.(*mheap).alloc(0x17dec20, 0x1, 0x1003e, 0xc363fe5d40)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/runtime/mheap.go:1047 +0x8a fp=0xc0e95a71f0 sp=0xc0e95a71a0 pc=0x42493a
    runtime.(*mcentral).grow(0x17dff20, 0x0)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/runtime/mcentral.go:256 +0x95 fp=0xc0e95a7238 sp=0xc0e95a71f0 pc=0x417875
    runtime.(*mcentral).cacheSpan(0x17dff20, 0xc363fe5d40)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/runtime/mcentral.go:106 +0x2ff fp=0xc0e95a7298 sp=0xc0e95a7238 pc=0x41737f
    runtime.(*mcache).refill(0x7f3065422d98, 0x3e)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/runtime/mcache.go:135 +0x86 fp=0xc0e95a72b8 sp=0xc0e95a7298 pc=0x416e16
    runtime.(*mcache).nextFree(0x7f3065422d98, 0xc363fd013e, 0x1, 0x1, 0x1)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/runtime/malloc.go:786 +0x88 fp=0xc0e95a72f0 sp=0xc0e95a72b8 pc=0x40b718
    runtime.mallocgc(0x400, 0xd1acc0, 0x851601, 0xc363fd0000)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/runtime/malloc.go:939 +0x76e fp=0xc0e95a7390 sp=0xc0e95a72f0 pc=0x40c02e
    runtime.growslice(0xd1acc0, 0xc3638cba00, 0x20, 0x20, 0x21, 0xc3638cba00, 0x10, 0x20)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/runtime/slice.go:181 +0x1e6 fp=0xc0e95a73f8 sp=0xc0e95a7390 pc=0x442c66
    go/parser.(*parser).parseStmtList(0xc363fd0000, 0xc3638cba00, 0x20, 0x20)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/go/parser/parser.go:1068 +0x10e fp=0xc0e95a7458 sp=0xc0e95a73f8 pc=0x849dce
    go/parser.(*parser).parseBody(0xc363fd0000, 0xc363fe25c0, 0x0)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/go/parser/parser.go:1082 +0x15f fp=0xc0e95a74e8 sp=0xc0e95a7458 pc=0x849fcf
    go/parser.(*parser).parseFuncDecl(0xc363fd0000, 0x0)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/go/parser/parser.go:2441 +0x366 fp=0xc0e95a75a8 sp=0xc0e95a74e8 pc=0x8530e6
    go/parser.(*parser).parseDecl(0xc363fd0000, 0xc000095770, 0x0, 0x0)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/go/parser/parser.go:2485 +0x155 fp=0xc0e95a7600 sp=0xc0e95a75a8 pc=0x853315
    go/parser.(*parser).parseFile(0xc363fd0000, 0x0)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/go/parser/parser.go:2540 +0x310 fp=0xc0e95a76f0 sp=0xc0e95a7600 pc=0x8536f0
    go/parser.ParseFile(0xc363da7680, 0xc00355ac00, 0x3b, 0xcaab20, 0xc363db0e20, 0x4, 0x0, 0x0, 0x0)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/go/parser/interface.go:117 +0x183 fp=0xc0e95a7768 sp=0xc0e95a76f0 pc=0x8428f3
    github.com/golangci/golangci-lint/vendor/golang.org/x/tools/imports.parse(0xc363da7680, 0xc00355ac00, 0x3b, 0xc354308800, 0x3455, 0x3655, 0x164bb60, 0x0, 0x0, 0xfbef00, ...)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/vendor/golang.org/x/tools/imports/imports.go:138 +0xee fp=0xc0e95a7820 sp=0xc0e95a7768 pc=0x9e1dbe
    github.com/golangci/golangci-lint/vendor/golang.org/x/tools/imports.process(0xc00355ac00, 0x3b, 0xc354308800, 0x3455, 0x3655, 0x164bb60, 0xc3638c7d80, 0xc363ea6000, 0x1f64, 0x3b2e, ...)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/vendor/golang.org/x/tools/imports/imports.go:66 +0x101 fp=0xc0e95a7958 sp=0xc0e95a7820 pc=0x9e1531
    github.com/golangci/golangci-lint/vendor/golang.org/x/tools/imports.Process(...)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/vendor/golang.org/x/tools/imports/imports.go:50
    github.com/golangci/golangci-lint/vendor/github.com/golangci/gofmt/goimports.Run(0xc00355ac00, 0x3b, 0x0, 0x0, 0x0, 0x0, 0x0)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/vendor/github.com/golangci/gofmt/goimports/golangci.go:17 +0x148 fp=0xc0e95a7a28 sp=0xc0e95a7958 pc=0xa00958
    github.com/golangci/golangci-lint/pkg/golinters.Gofmt.Run(0x1, 0xfd5360, 0xc000073aa0, 0xc0a7a5f3b0, 0xc0ab317c70, 0x1, 0x1, 0xfdc200, 0xc0ab2e3e80)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/gofmt.go:293 +0x112 fp=0xc0e95a7b50 sp=0xc0e95a7a28 pc=0xbdb4e2
    github.com/golangci/golangci-lint/pkg/golinters.(*Gofmt).Run(0xc0003df341, 0xfd5360, 0xc000073aa0, 0xc0a7a5f3b0, 0xc0aa125230, 0xc0495d8ae0, 0x17e2d20, 0xc007e71911, 0x4)
    	<autogenerated>:1 +0x61 fp=0xc0e95a7ba8 sp=0xc0e95a7b50 pc=0xbe77c1
    github.com/golangci/golangci-lint/pkg/lint.(*Runner).runLinterSafe(0xc071780ee0, 0xfd5360, 0xc000073aa0, 0xc0aafb6a80, 0xc000588e80, 0x0, 0x0, 0x0, 0x0, 0x0)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:112 +0x16a fp=0xc0e95a7ca8 sp=0xc0e95a7ba8 pc=0xc0846a
    github.com/golangci/golangci-lint/pkg/lint.Runner.runWorker.func1()
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:146 +0x64 fp=0xc0e95a7d18 sp=0xc0e95a7ca8 pc=0xc0a144
    github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc0a7a39900, 0xe16ca9, 0x9, 0xc0047d4e40)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go:75 +0x50 fp=0xc0e95a7d78 sp=0xc0e95a7d18 pc=0xc03730
    github.com/golangci/golangci-lint/pkg/lint.Runner.runWorker(0xc0ab022120, 0x11, 0x11, 0xfdf320, 0xc0ab340f30, 0xfd5360, 0xc000073aa0, 0xc0aafb6a80, 0xc0ab374f60, 0xc0ab375020, ...)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:145 +0x23b fp=0xc0e95a7ee0 sp=0xc0e95a7d78 pc=0xc0882b
    github.com/golangci/golangci-lint/pkg/lint.(*Runner).runWorkers.func1(0xc0ab3ca960, 0xc0ab3aca20, 0xfd5360, 0xc000073aa0, 0xc0aafb6a80, 0xc0ab374f60, 0xc0ab375020, 0xc0ab375080, 0x4, 0x4, ...)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:200 +0x163 fp=0xc0e95a7f88 sp=0xc0e95a7ee0 pc=0xc0a373
    runtime.goexit()
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/runtime/asm_amd64.s:1337 +0x1 fp=0xc0e95a7f90 sp=0xc0e95a7f88 pc=0x45b211
    created by github.com/golangci/golangci-lint/pkg/lint.(*Runner).runWorkers
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:197 +0x1ab
    
    goroutine 1 [chan receive]:
    github.com/golangci/golangci-lint/pkg/printers.JSON.Print(0xc00040f3e0, 0xfd5360, 0xc000073aa0, 0xc0ab375200, 0xc00040f380, 0xc0ab375200)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/printers/json.go:30 +0xab
    github.com/golangci/golangci-lint/pkg/commands.(*Executor).runAndPrint(0xc00040f380, 0xfd5360, 0xc000073aa0, 0xc000073a40, 0x0, 0x6, 0x0, 0x0)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/commands/run.go:350 +0x253
    github.com/golangci/golangci-lint/pkg/commands.(*Executor).executeRun(0xc00040f380, 0xc0005b2f00, 0xc000073a40, 0x0, 0x6)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/commands/run.go:398 +0x153
    github.com/golangci/golangci-lint/vendor/github.com/spf13/cobra.(*Command).execute(0xc0005b2f00, 0xc000073980, 0x6, 0x6, 0xc0005b2f00, 0xc000073980)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/vendor/github.com/spf13/cobra/command.go:760 +0x2ae
    github.com/golangci/golangci-lint/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc0005b2c80, 0x6, 0xfa8bf0, 0x7)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/vendor/github.com/spf13/cobra/command.go:846 +0x2ec
    github.com/golangci/golangci-lint/vendor/github.com/spf13/cobra.(*Command).Execute(...)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/vendor/github.com/spf13/cobra/command.go:794
    github.com/golangci/golangci-lint/pkg/commands.(*Executor).Execute(...)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/commands/executor.go:107
    main.main()
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/cmd/golangci-lint/main.go:20 +0x80
    
    goroutine 24970 [chan receive]:
    github.com/golangci/golangci-lint/pkg/commands.(*Executor).setExitCodeIfIssuesFound.func1(0xc0ab3751a0, 0xc0ab375200, 0xc00040f380)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/commands/run.go:309 +0x134
    created by github.com/golangci/golangci-lint/pkg/commands.(*Executor).setExitCodeIfIssuesFound
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/commands/run.go:307 +0x71
    
    goroutine 24964 [running]:
    	goroutine running on other thread; stack unavailable
    created by github.com/golangci/golangci-lint/pkg/lint.(*Runner).runWorkers
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:197 +0x1ab
    
    goroutine 24963 [runnable]:
    syscall.Syscall6(0x106, 0xffffffffffffff9c, 0xc363793060, 0xc363e41078, 0x0, 0x0, 0x0, 0x0, 0xc363e41078, 0x0)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/syscall/asm_linux_amd64.s:44 +0x5
    syscall.fstatat(0xffffffffffffff9c, 0xc363793040, 0x1e, 0xc363e41078, 0x0, 0x0, 0x1e)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/syscall/zsyscall_linux_amd64.go:1520 +0xcb
    syscall.Stat(...)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/syscall/syscall_linux_amd64.go:64
    os.statNolog(0xc363793040, 0x1e, 0xc363793040, 0x1e, 0x1, 0xc363793040)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/os/stat_unix.go:31 +0x6f
    os.Stat(0xc363793040, 0x1e, 0x3, 0x3, 0xc363793040, 0x1e)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/os/stat.go:13 +0x4d
    go/build.(*Context).isDir(0x17d8c20, 0xc363793040, 0x1e, 0x3)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/go/build/build.go:131 +0x4a
    go/build.(*Context).Import(0x17d8c20, 0xc08417e561, 0x16, 0xc0030f7840, 0x32, 0x3, 0xcb5260, 0x40bba9, 0x71)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/go/build/build.go:671 +0x5b7f
    go/build.Import(...)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/go/build/build.go:1280
    github.com/golangci/golangci-lint/vendor/golang.org/x/tools/go/internal/gcimporter.FindPkg(0xc08417e561, 0x16, 0xc0030f7840, 0x32, 0xc0030f7840, 0x40894d, 0xc0030f7840, 0x6a17b17771207df0)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go:56 +0x330
    github.com/golangci/golangci-lint/vendor/golang.org/x/tools/go/gcexportdata.Find(...)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go:45
    github.com/golangci/golangci-lint/vendor/golang.org/x/tools/go/gcexportdata.importer.ImportFrom(0xc000160e80, 0xc36322d620, 0xc08417e561, 0x16, 0xc0030f7840, 0x32, 0x0, 0x0, 0x0, 0x0)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/vendor/golang.org/x/tools/go/gcexportdata/importer.go:40 +0x7f
    go/types.(*Checker).importPackage(0xc0006adc20, 0x35ebcef, 0xc08417e561, 0x16, 0xc0030f7840, 0x32, 0xc363bc5c20)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/go/types/resolver.go:156 +0x180
    go/types.(*Checker).collectObjects(0xc0006adc20)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/go/types/resolver.go:256 +0x15f9
    go/types.(*Checker).checkFiles(0xc0006adc20, 0xc362b938c8, 0x1, 0x1, 0x0, 0x0)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/go/types/check.go:252 +0x97
    go/types.(*Checker).Files(...)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/go/types/check.go:245
    go/types.(*Config).Check(0xc36322b700, 0xc084079310, 0x4, 0xc000160e80, 0xc362b938c8, 0x1, 0x1, 0xc3632304b0, 0x0, 0xc36308f790, ...)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/go/types/api.go:351 +0x11c
    github.com/golangci/golangci-lint/vendor/github.com/golangci/lint-1.(*pkg).typeCheck(0xc363230460, 0x4cb8a3, 0xc08b8725a0)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/vendor/github.com/golangci/lint-1/lint.go:324 +0x313
    github.com/golangci/golangci-lint/vendor/github.com/golangci/lint-1.(*pkg).lint(0xc363230460, 0xc36322d5f0, 0xc0030f7840, 0x3a)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/vendor/github.com/golangci/lint-1/lint.go:194 +0x40
    github.com/golangci/golangci-lint/vendor/github.com/golangci/lint-1.(*Linter).LintASTFiles(0xc216aa9990, 0xc362b938b8, 0x1, 0x1, 0xc000160e80, 0x1, 0xc362b938b8, 0x0, 0x1, 0xc00355b900)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/vendor/github.com/golangci/lint-1/lint.go:156 +0x7f0
    github.com/golangci/golangci-lint/pkg/golinters.Golint.lintPkg(0x0, 0xc362b938b8, 0x1, 0x1, 0xc000160e80, 0xc000160e80, 0x0, 0x0, 0x0, 0x0)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/golint.go:50 +0x74
    github.com/golangci/golangci-lint/pkg/golinters.Golint.Run(0xfd5360, 0xc000073aa0, 0xc0ab3cef50, 0xc0ab317c70, 0x1, 0x1, 0xfdc200, 0xc0ab2e3e80)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/golint.go:34 +0x130
    github.com/golangci/golangci-lint/pkg/lint.(*Runner).runLinterSafe(0xc0781ffee0, 0xfd5360, 0xc000073aa0, 0xc0aafb6a80, 0xc000588600, 0x0, 0x0, 0x0, 0x0, 0x0)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:112 +0x16a
    github.com/golangci/golangci-lint/pkg/lint.Runner.runWorker.func1()
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:146 +0x64
    github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc0ab3d0050, 0xdf71f7, 0x6, 0xc001ff0e40)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go:75 +0x50
    github.com/golangci/golangci-lint/pkg/lint.Runner.runWorker(0xc0ab022120, 0x11, 0x11, 0xfdf320, 0xc0ab340f30, 0xfd5360, 0xc000073aa0, 0xc0aafb6a80, 0xc0ab374f60, 0xc0ab375020, ...)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:145 +0x23b
    github.com/golangci/golangci-lint/pkg/lint.(*Runner).runWorkers.func1(0xc0ab3ca960, 0xc0ab3aca20, 0xfd5360, 0xc000073aa0, 0xc0aafb6a80, 0xc0ab374f60, 0xc0ab375020, 0xc0ab375080, 0x4, 0x4, ...)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:200 +0x163
    created by github.com/golangci/golangci-lint/pkg/lint.(*Runner).runWorkers
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:197 +0x1ab
    
    goroutine 24969 [chan receive]:
    github.com/golangci/golangci-lint/pkg/lint.collectIssues.func1(0xc0ab3751a0, 0xc0ab375140)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:267 +0x8f
    created by github.com/golangci/golangci-lint/pkg/lint.collectIssues
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:264 +0x62
    
    goroutine 24968 [chan receive]:
    github.com/golangci/golangci-lint/pkg/lint.Runner.processLintResults.func1(0xc0ab3aca50, 0xc0ab375140, 0xc0ab375020)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:230 +0x194
    created by github.com/golangci/golangci-lint/pkg/lint.Runner.processLintResults
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:224 +0xb6
    
    goroutine 24967 [semacquire]:
    sync.runtime_Semacquire(0xc0ab3ca968)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/runtime/sema.go:56 +0x39
    sync.(*WaitGroup).Wait(0xc0ab3ca960)
    	/home/travis/.gimme/versions/go1.12.1.linux.amd64/src/sync/waitgroup.go:130 +0x65
    github.com/golangci/golangci-lint/pkg/lint.(*Runner).runWorkers.func2(0xc0ab3ca960, 0xc0ab375020, 0xc0ab3aca20, 0xc0ab375080, 0x4, 0x4)
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:212 +0x2f
    created by github.com/golangci/golangci-lint/pkg/lint.(*Runner).runWorkers
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:211 +0x2d9
    
    goroutine 24966 [running]:
    	goroutine running on other thread; stack unavailable
    created by github.com/golangci/golangci-lint/pkg/lint.(*Runner).runWorkers
    	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:197 +0x1ab

Failure running on github.com/go-openapi repos

Since friday, we have met failures on several PRs on our repos: the GolangCI engine seems unhappy resolving go 11 dependencies with modules.

Typical messages are:

ErrorFailed to load program with go/packages: go [list -e -json -compiled -test=true -export=false -deps=true -- ./...]: exit status 1: go build github.com/go-openapi/analysis: no Go files in
go build github.com/go-openapi/spec: no Go files in
go build github.com/go-openapi/swag: no Go files in
"

And:

Warning in prepare repoFetch deps: go mod: command failed: go: finding github.com/pmezard/go-difflib v1.0.0
go: finding github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
go: finding github.com/PuerkitoBio/purell v1.1.0
go: finding github.com/stretchr/testify v1.2.2
go: finding github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb
go: finding github.com/go-openapi/swag v0.17.0
go: finding github.com/go-openapi/errors v0.17.0
go: finding github.com/davecgh/go-spew v1.1.1
go: finding golang.org/x/text v0.3.0
go: finding gopkg.in/yaml.v2 v2.2.1
go: finding github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329
go: finding github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277
go: finding github.com/go-openapi/jsonreference v0.17.0
go: verifying github.com/go-openapi/[email protected]/go.mod: checksum mismatch
downloaded: h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
go.sum: h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
: exit status 1

This blocks several PRs:
go-openapi/analysis#40
go-openapi/loads#20
go-openapi/loads#21
go-openapi/spec#85

golangci doesn't install none-go files in vendor when using go mod

Our project just switched from dep to go mod.
When we use dep, we use the option to keep all non-go files(including .cpp, .h etc) for some of our dependencies in order to compile our binary.
Now we switched to go mod, the mods in $GOPATH/pkg/mod/ keeps all files of a packages, but when you port them into vendor folder by default it only keep go files.
It seems golangci ports mod to vendor folder and because of missing necessary none go files, it failed to analyze.
You can find the failed run here: https://golangci.com/r/github.com/iotexproject/iotex-core/pulls/1177

Maybe https://github.com/goware/modvendor could help to fix this issue.

Thanks

Exclude unstaged files

I think it would be a good idea to exclude unstaged files.

Sometimes I create a commit without staging all the files, it happens to me a lot when I have to fix a bug, and I find my self checked out on another branch, with new files that could not be stashed.

When I run golangci-lint manually I can easily exclude them, but in the case of a pre-commit-hook, it would be a lot easier to have them ignored automatically.

Another improvement would be to exclude unstaged changes, however most linters would not be able support it.

Reports SA5008: duplicate struct tag error for valid use

Problem:
GolangCI reports an error:

SA5008: duplicate struct tag "choice"
Method string short:"m" long:"method" choice:"get" choice:"put" description:"HTTP method that needs to be presigned" default:"get"

This is the code line that it complains about:

Method string `short:"m" long:"method" choice:"get" choice:"put" description:"HTTP method that needs to be presigned" default:"get"`

Here the choice tag used multiple times here.
However, according to the documentation for go-flags package, this is the right way to use it: https://godoc.org/github.com/jessevdk/go-flags

Here is the code snippet:

var opts struct {
	Bucket string `short:"b" long:"bucket" description:"S3 bucket" env:"S3_BUCKET" required:"true"`
	Path   string `short:"p" long:"path" description:"S3 path" env:"S3_PATH" required:"true"`
	Method string `short:"m" long:"method" choice:"get" choice:"put" description:"HTTP method that needs to be presigned" default:"get"`
	Expiry int64  `short:"e" long:"expiry" description:"Expiration time for the url in seconds" default:"7200"`
}

func main() {
	parser := flags.NewParser(&opts, flags.Default)

	if _, err := parser.Parse(); err != nil {
		os.Exit(1)
	}
}

Expected behaviour:
golangCI should not mark it as Failure

<html lang="ru">

Chrome keeps offering to translate for me despite the page being in English - I think this is because the HTML tag says it's russian… <html lang="ru">

Organization repository is not shown

I cannot add an organization repo (public), or at least I don't find a way to do so.

The repo I would like to add is https://github.com/gojisvm/gojis, which was moved from https://github.com/TimSatke/gojis, where I've used golangci successfully.

I cannot use golangci by editing the webhook, by trying to enter the repo url in the search field manually, or by selecting the repo from the list of my repositories (because it doesn't show up).

Is there any kind of workaround?

No way to disconnect and reconnect repositories after manually deleting webhook

I want to reconnect a repository to GolangCI after manually deleting the webhook, but the API returns 500. My guess is that it attempts to delete a non-existent GitHub webhook, gets an error from the GitHub API (since that webhook doesn't exist), and fails.

This makes it impossible for me to add the webhook back to my repository. In general, it would be great if a webhook URL was provided for authenticated repository owners to manually reconfigure their GitHub repository.

Can't post connect the repo

Hello i can't connect the repo "xf0e/open-ocr" because of error:

"Can't post activate repo request"

Can you help me?

Thanks!

GolangCI - Processing Timeout

GolangCI check's status is "Processing Timeout" and blocking a current PR. I am unable to retry or find any additional details about the timeout. It might be helpful to provide a link to the current details of the GolangCI status as well as a retry option to avoid situations where unexpected errors occur.

Failure running on orbs-network/orbs-network-go

Hi there
Getting weird errors all of a sudden at https://golangci.com/r/github.com/orbs-network/orbs-network-go
Used to work up until a few days ago

Error
Failed to load program with go/packages: go [list -e -json -compiled -test=false -export=false -deps=true -tags mytag -- ./...]: exit status 1: go build github.com/orbs-network/orbs-spec/types/go/primitives: no Go files in 
go build github.com/pkg/errors: no Go files in 
go build github.com/VividCortex/ewma: no Go files in 
go build github.com/codahale/hdrhistogram: no Go files in 
go build github.com/orbs-network/membuffers/go: no Go files in 
go build github.com/orbs-network/orbs-spec/types/go/protocol: no Go files in 
go build github.com/orbs-network/orbs-spec/types/go/services: no Go files in 
go build golang.org/x/crypto/ed25519: no Go files in 
go build github.com/orbs-network/orbs-spec/types/go/protocol/consensus: no Go files in 
go build github.com/orbs-network/orbs-spec/types/go/protocol/client: no Go files in 
go build github.com/orbs-network/go-mock: no Go files in 
go build github.com/google/go-cmp/cmp: no Go files in 
go build github.com/orbs-network/orbs-spec/types/go/services/gossiptopics: no Go files in 
go build github.com/stretchr/testify/require: no Go files in 
go build github.com/orbs-network/orbs-spec/types/go/services/handlers: no Go files in 
go build github.com/stretchr/testify/assert: no Go files in 
go build github.com/orbs-network/lean-helix-go: no Go files in 
go build github.com/orbs-network/orbs-spec/types/go/protocol/gossipmessages: no Go files in 
go build github.com/orbs-network/lean-helix-go/primitives: no Go files in 
go build golang.org/x/crypto/ripemd160: no Go files in 
go build github.com/orbs-network/orbs-contract-sdk/go/sdk: no Go files in 
"

Warning in prepare repo
Fetch deps: sync deps: deps check failed: level=warning msg="[runner] can't process result by autogenerated_exclude processor: can't filter issue result.issue{fromlinter:"typecheck", text:"services/blockstorage/sync/harness.go:5:2: cannot find package \"github.com/orbs-network/go-mock\" in any of:\
\ /tmp/tmp.3tcquuiwte/src/github.com/orbs-network/orbs-network-go/vendor/github.com/orbs-network/go-mock (vendor tree)\
\ /usr/local/go/src/github.com/orbs-network/go-mock (from $goroot)\
\ /tmp/tmp.3tcquuiwte/src/github.com/orbs-network/go-mock (from $gopath)", pos:token.position{filename:"", offset:0, line:0, column:0}, linerange:(*result.range)(nil), hunkpos:0, sourcelines:[]string(nil)}: can't parse file : read /tmp/tmp.3tcquuiwte/src/github.com/orbs-network/orbs-network-go: is a directory"

Gitea support

Hi, do you plan on integrating support for Gitea? Gitea's API is pretty similar to GitHub's, so it shouldn't be too difficult to integrate.

Error: failed to load program with go/packages

I am using go modules and getting the following error.

$ GOLANGCI_COM_RUN=1 golangci-lint run --out-format=json --issues-exit-code=0 --deadline=5m --new=false --new-from-rev= --new-from-patch=
    Running error: context loading failed: failed to load program with go/packages: go [list -e -json -compiled -test=false -export=false -deps=true -find=false -- ./...]: exit status 2: # github.com/mailchain/mailchain/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1
    vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/curve.go:42:44: fatal error: libsecp256k1/include/secp256k1.h: No such file or directory
     #include "libsecp256k1/include/secp256k1.h"
                                                ^
    compilation terminated.
Error: failed to load program with go/packages

The prepare repo gets the repos but fails checking dependencies.

    Synced deps
    Checking deps...
    internal/pkg/crypto/keys/secp256k1/private.go:1: vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/curve.go:45:8: could not import C (no metadata for C) (typecheck)
    // Copyright 2019 Finobo
    internal/pkg/mailbox/pubkey.go:1: vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/curve.go:45:8: could not import C (no metadata for C) (typecheck)
    // Copyright 2019 Finobo
    internal/pkg/clients/etherscan/api.go:1: vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/curve.go:45:8: could not import C (no metadata for C) (typecheck)
    // Copyright 2019 Finobo
    Deps checking: bad: internal/pkg/crypto/keys/secp256k1/private.go:1: vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/curve.go:45:8: could not import c (no metadata for c) (typecheck)
    Checking deps...
    internal/pkg/crypto/keys/secp256k1/private.go:1: vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/curve.go:45:8: could not import C (no metadata for C) (typecheck)
    // Copyright 2019 Finobo
    internal/pkg/mailbox/pubkey.go:1: vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/curve.go:45:8: could not import C (no metadata for C) (typecheck)
    // Copyright 2019 Finobo
    internal/pkg/clients/etherscan/api.go:1: vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/curve.go:45:8: could not import C (no metadata for C) (typecheck)
    // Copyright 2019 Finobo
    Deps checking: bad: internal/pkg/crypto/keys/secp256k1/private.go:1: vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/curve.go:45:8: could not import c (no metadata for c) (typecheck)
    [WARN] Failed to sync deps
    [WARN] Failed to fetch dependecies

Do you know how to resolve this?

GolangCI is calling older versions of golangci-lint with --timeout option

Our integrations in GolangCI fail using latest Docker image with error message:

$ GOLANGCI_COM_RUN=1 golangci-lint run --out-format=json --issues-exit-code=0 --timeout=5m --new=false --new-from-rev= --new-from-patch=../changes.patch
    Can't get config for command line: can't parse args: unknown flag: --timeout

I suspect this is due to deprecation of --deadline switch in favour of --timeout, however the version we request via config (1.18.0) does not support --timeout.

how to set golangci working directory

my source code is in a sub directory of my git repo which called src, so when i run golangci-lint run --new-from-rev=HEAD~ , would the option --new-from-rev works well ?

i think the option --new-form-rev may read the .git to tell which is the newest commits , but when i tried golangci-lint run src/ it would showed like cannot import absolute path , what should i do

Go modules and GOPATH

When I use the golangci.com service, it checks out my project in the GOPATH at /go/src/.... I also vendor all dependencies in the project and thus use -mod vendor when making deps. This causes everything related to modules to fail since modules don't work when running commands within the GOPATH. The simple solution is to check out the project to somewhere outside of the GOPATH and everything would work fine. I tried setting project-path to an absolute path but it still put things in the GOPATH.

Is there any way to check out the code outside of the GOPATH or do you know of some other workaround to make -mod vendor and modules work within the GOPATH?

Make GitHub App

This allows an org to authorize app only on certain repos. From twitter

Document required Github permissions

I'd like to use golangci with some of my projects, but it seems to request read/write access to everything including the settings of my repository. Does golangci really need these broad permissions? If so, perhaps you could add some documentation explaining what golangci will do with this access?

Service shutdown

Looks like service is not working now, is there any information about it?

Private repos and paid plans

Please thumb up the issue if you are interested in private github repos support as a paid monthly plan. We will notify you when it will be launched.

golangci not catching junk in PR

Hey golangci team,
I'm working with the go-swagger team to enable golangci on their repo; however, after we turned it on and sent in a PR full of junk, golangCI says its A-OK :(

Is there a service level issue? or did we configure something wrong?

See the pile-o-junk PR here:
go-swagger/go-swagger#1580

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.