Skip to content

Commit a4d735f

Browse files
committed
Cache go/analysis facts
Don't load unneeded packages for go/analysis. Repeated run of go/analysis linters now 10x faster (2s vs 20s on this repo) than before.
1 parent 93bb0fd commit a4d735f

35 files changed

+3323
-704
lines changed

.golangci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ linters-settings:
1111
golint:
1212
min-confidence: 0
1313
gocyclo:
14-
min-complexity: 10
14+
min-complexity: 15
1515
maligned:
1616
suggest-new: true
1717
dupl:
@@ -86,7 +86,7 @@ linters:
8686
run:
8787
skip-dirs:
8888
- test/testdata_etc
89-
- pkg/golinters/goanalysis/(checker|passes)
89+
- internal/(cache|renameio|robustio)
9090

9191
issues:
9292
exclude-rules:

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ test: export GOLANGCI_LINT_INSTALLED = true
1919

2020
test: build
2121
GL_TEST_RUN=1 time ./golangci-lint run -v
22-
GL_TEST_RUN=1 time ./golangci-lint run --fast --no-config -v --skip-dirs 'test/testdata_etc,pkg/golinters/goanalysis/(checker|passes)'
23-
GL_TEST_RUN=1 time ./golangci-lint run --no-config -v --skip-dirs 'test/testdata_etc,pkg/golinters/goanalysis/(checker|passes)'
22+
GL_TEST_RUN=1 time ./golangci-lint run --fast --no-config -v --skip-dirs 'test/testdata_etc,internal/(cache|renameio|robustio)'
23+
GL_TEST_RUN=1 time ./golangci-lint run --no-config -v --skip-dirs 'test/testdata_etc,internal/(cache|renameio|robustio)'
2424
GL_TEST_RUN=1 time go test -v ./...
2525

2626
.PHONY: test

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ linters-settings:
878878
golint:
879879
min-confidence: 0
880880
gocyclo:
881-
min-complexity: 10
881+
min-complexity: 15
882882
maligned:
883883
suggest-new: true
884884
dupl:
@@ -953,7 +953,7 @@ linters:
953953
run:
954954
skip-dirs:
955955
- test/testdata_etc
956-
- pkg/golinters/goanalysis/(checker|passes)
956+
- internal/(cache|renameio|robustio)
957957
958958
issues:
959959
exclude-rules:

go.sum

-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T
187187
github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI=
188188
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
189189
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
190-
github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
191190
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
192191
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
193192
github.com/securego/gosec v0.0.0-20190912120752-140048b2a218 h1:O0yPHYL49quNL4Oj2wVq+zbGMu4dAM6iLoOQtm49TrQ=

0 commit comments

Comments
 (0)