Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contextcheck: bump to v1.0.6 && re-enable #3102

Merged
merged 4 commits into from
Aug 23, 2022
Merged

Conversation

sylvia7788
Copy link
Contributor

@sylvia7788 sylvia7788 commented Aug 16, 2022

  1. refactor using the Fact feature to solve the cache problem, which may cause a little bit slow, so we add a switch to turn off Fact if you use this lint in docker ci
linters-settings:
  contextcheck:
    disable-fact: true
  1. add new check for net/http.HandleFunc
  2. re-enable for go1.18

kkHAIKE/contextcheck@v1.0.4...v1.0.6

@ldez
Copy link
Member

ldez commented Aug 16, 2022

kkHAIKE/contextcheck#4

@ldez
Copy link
Member

ldez commented Aug 16, 2022

the option need to be added and commented in https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml

@ldez ldez added feedback required Requires additional feedback linter: update version Update version of linter labels Aug 16, 2022
@ldez ldez changed the title contextcheck: bump to v1.0.6 && re-enable for go1.18 contextcheck: bump to v1.0.6 && re-enable Aug 17, 2022
@ldez ldez removed the feedback required Requires additional feedback label Aug 17, 2022
@ldez
Copy link
Member

ldez commented Aug 18, 2022

I did some benchmarks.

current version (v1.0.4)
goos: linux
goarch: amd64
pkg: github.com/golangci/golangci-lint/test/bench
cpu: 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz
Benchmark_linters
Benchmark_linters/contextcheck
Benchmark_linters/contextcheck/golangci/golangci-lint
2022/08/19 01:39:54 contextcheck on golangci/golangci-lint (34 kLoC): time: 1.585822751s
Benchmark_linters/contextcheck/golangci/golangci-lint-16         	       1	1596072941 ns/op
Benchmark_linters/contextcheck/gohugoio/hugo
2022/08/19 01:40:05 contextcheck on gohugoio/hugo (162 kLoC): time: 10.742384616s
Benchmark_linters/contextcheck/gohugoio/hugo-16                  	       1	10753507654 ns/op
Benchmark_linters/contextcheck/ethereum/go-ethereum
2022/08/19 01:40:17 contextcheck on ethereum/go-ethereum (333 kLoC): time: 11.878757337s
Benchmark_linters/contextcheck/ethereum/go-ethereum-16           	       1	11891778826 ns/op
Benchmark_linters/contextcheck/astaxie/beego
2022/08/19 01:40:19 contextcheck on astaxie/beego (75 kLoC): time: 2.607164538s
Benchmark_linters/contextcheck/astaxie/beego-16                  	       1	2615898098 ns/op
Benchmark_linters/contextcheck/hashicorp/terraform
2022/08/19 01:40:29 contextcheck on hashicorp/terraform (353 kLoC): time: 9.547556869s
Benchmark_linters/contextcheck/hashicorp/terraform-16            	       1	9566533803 ns/op
Benchmark_linters/contextcheck/hashicorp/consul
    bench_test.go:77: can't run golangci-lint: exit status 3, level=error msg="[runner] Panic: contextcheck: package \"proxycfg\" (isInitialPkg: true, needAnalyzeSource: true): runtime error: invalid memory address or nil pointer dereference: goroutine 21098 [running]:\nruntime/debug.Stack()\n\t/home/ldez/go1.19/src/runtime/debug/stack.go:24 +0x65\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1()\n\tgo/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:101 +0x155\npanic({0x15502e0, 0x204d040})\n\t/home/ldez/go1.19/src/runtime/panic.go:884 +0x212\ngithub.com/sylvia7788/contextcheck.(*runner).buildPkg(0xc01e9e8090?, 0xc023b80b60)\n\tgithub.com/sylvia7788/contextcheck@v1.0.4/contextcheck.go:273 +0x32\ngithub.com/sylvia7788/contextcheck.(*runner).checkFuncWithCtx(0xc02a463d08, 0xc0338ec4e0)\n\tgithub.com/sylvia7788/contextcheck@v1.0.4/contextcheck.go:327 +0x350\ngithub.com/sylvia7788/contextcheck.(*runner).run(0xc02a463d08, 0xc01d4d69c0)\n\tgithub.com/sylvia7788/contextcheck@v1.0.4/contextcheck.go:101 +0x2c5\ngithub.com/sylvia7788/contextcheck.NewRun.func1(0x153ab00?)\n\tgithub.com/sylvia7788/contextcheck@v1.0.4/contextcheck.go:57 +0x33\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0xc000915e80)\n\tgo/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:187 +0x9d6\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2()\n\tgo/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:105 +0x1d\ngithub.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc0021986e0, {0x16ecee5, 0xc}, 0xc0016e4748)\n\tgo/src/github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go:111 +0x4a\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0xc000c56e40?)\n\tgo/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:104 +0x85\ngithub.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0xc000915e80)\n\tgo/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:80 +0xb4\ncreated by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze\n\tgo/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:75 +0x1eb\n"
        level=warning msg="[runner] Can't run linter contextcheck: contextcheck: contextcheck: package \"proxycfg\" (isInitialPkg: true, needAnalyzeSource: true): runtime error: invalid memory address or nil pointer dereference"
        level=error msg="Running error: 1 error occurred:\n\t* can't run linter contextcheck: contextcheck: contextcheck: package \"proxycfg\" (isInitialPkg: true, needAnalyzeSource: true): runtime error: invalid memory address or nil pointer dereference\n\n"
--- FAIL: Benchmark_linters/contextcheck/hashicorp/consul
Benchmark_linters/contextcheck/traefik/traefik
2022/08/19 01:40:53 contextcheck on traefik/traefik (132 kLoC): time: 7.914312883s
Benchmark_linters/contextcheck/traefik/traefik-16                	       1	7922969369 ns/op
Benchmark_linters/contextcheck/go_source_code
2022/08/19 01:40:56 contextcheck on go source code (339 kLoC): time: 2.402004264s
Benchmark_linters/contextcheck/go_source_code-16                 	       1	2439689606 ns/op


PR (DisableFact : false)
goos: linux
goarch: amd64
pkg: github.com/golangci/golangci-lint/test/bench
cpu: 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz
Benchmark_linters
Benchmark_linters/contextcheck
Benchmark_linters/contextcheck/golangci/golangci-lint
2022/08/19 01:04:43 contextcheck on golangci/golangci-lint (34 kLoC): time: 3.697457285s
Benchmark_linters/contextcheck/golangci/golangci-lint-16         	       1	3707201692 ns/op
Benchmark_linters/contextcheck/gohugoio/hugo
2022/08/19 01:05:00 contextcheck on gohugoio/hugo (162 kLoC): time: 17.153564158s
Benchmark_linters/contextcheck/gohugoio/hugo-16                  	       1	17165378500 ns/op
Benchmark_linters/contextcheck/ethereum/go-ethereum
2022/08/19 01:05:16 contextcheck on ethereum/go-ethereum (333 kLoC): time: 15.409161416s
Benchmark_linters/contextcheck/ethereum/go-ethereum-16           	       1	15420912400 ns/op
Benchmark_linters/contextcheck/astaxie/beego
2022/08/19 01:05:21 contextcheck on astaxie/beego (75 kLoC): time: 4.796906305s
Benchmark_linters/contextcheck/astaxie/beego-16                  	       1	4805741875 ns/op
Benchmark_linters/contextcheck/hashicorp/terraform
2022/08/19 01:05:37 contextcheck on hashicorp/terraform (353 kLoC): time: 15.727273433s
Benchmark_linters/contextcheck/hashicorp/terraform-16            	       1	15745659405 ns/op
Benchmark_linters/contextcheck/hashicorp/consul
2022/08/19 01:06:03 contextcheck on hashicorp/consul (502 kLoC): time: 25.84789742s
Benchmark_linters/contextcheck/hashicorp/consul-16               	       1	25873111418 ns/op
Benchmark_linters/contextcheck/traefik/traefik
2022/08/19 01:06:23 contextcheck on traefik/traefik (132 kLoC): time: 19.6706203s
Benchmark_linters/contextcheck/traefik/traefik-16                	       1	19682449913 ns/op
Benchmark_linters/contextcheck/go_source_code
2022/08/19 01:06:27 contextcheck on go source code (339 kLoC): time: 4.599884425s
Benchmark_linters/contextcheck/go_source_code-16                 	       1	4635807624 ns/op
PR (DisableFact : true)
goos: linux
goarch: amd64
pkg: github.com/golangci/golangci-lint/test/bench
cpu: 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz
Benchmark_linters
Benchmark_linters/contextcheck
Benchmark_linters/contextcheck/golangci/golangci-lint
2022/08/19 01:10:48 contextcheck on golangci/golangci-lint (34 kLoC): time: 1.659752684s
Benchmark_linters/contextcheck/golangci/golangci-lint-16         	       1	1667280979 ns/op
Benchmark_linters/contextcheck/gohugoio/hugo
2022/08/19 01:11:00 contextcheck on gohugoio/hugo (162 kLoC): time: 11.171557053s
Benchmark_linters/contextcheck/gohugoio/hugo-16                  	       1	11184450116 ns/op
Benchmark_linters/contextcheck/ethereum/go-ethereum
2022/08/19 01:11:12 contextcheck on ethereum/go-ethereum (333 kLoC): time: 12.09250438s
Benchmark_linters/contextcheck/ethereum/go-ethereum-16           	       1	12105824323 ns/op
Benchmark_linters/contextcheck/astaxie/beego
2022/08/19 01:11:15 contextcheck on astaxie/beego (75 kLoC): time: 2.610712093s
Benchmark_linters/contextcheck/astaxie/beego-16                  	       1	2620544178 ns/op
Benchmark_linters/contextcheck/hashicorp/terraform
2022/08/19 01:11:24 contextcheck on hashicorp/terraform (353 kLoC): time: 9.620776204s
Benchmark_linters/contextcheck/hashicorp/terraform-16            	       1	9640397704 ns/op
Benchmark_linters/contextcheck/hashicorp/consul
2022/08/19 01:11:40 contextcheck on hashicorp/consul (502 kLoC): time: 15.526233151s
Benchmark_linters/contextcheck/hashicorp/consul-16               	       1	15551715790 ns/op
Benchmark_linters/contextcheck/traefik/traefik
2022/08/19 01:11:48 contextcheck on traefik/traefik (132 kLoC): time: 7.495335096s
Benchmark_linters/contextcheck/traefik/traefik-16                	       1	7506985549 ns/op
Benchmark_linters/contextcheck/go_source_code
2022/08/19 01:11:50 contextcheck on go source code (339 kLoC): time: 2.310968916s
Benchmark_linters/contextcheck/go_source_code-16                 	       1	2349470457 ns/op

.golangci.reference.yml Outdated Show resolved Hide resolved
@ldez ldez merged commit cc2d97f into golangci:master Aug 23, 2022
@kkHAIKE
Copy link
Contributor

kkHAIKE commented Aug 25, 2022

@ldez how to trigger the depnedbot... i will release a new tag for a bugfix

@ldez
Copy link
Member

ldez commented Aug 25, 2022

@kkHAIKE you have to wait, the update happens every Sunday

In some cases, I can trigger the bot but this doesn't mean that we will create a release just for your linter.

SeigeC pushed a commit to SeigeC/golangci-lint that referenced this pull request Apr 4, 2023
@ldez ldez added this to the v1.49 milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linter: update version Update version of linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants