Skip to content

Commit d401b29

Browse files
author
Shashank Sinha
authored
tools: Update build process (#440)
* Use go generate for tools build * Remove usage of gofumports
1 parent a3e90b1 commit d401b29

File tree

4 files changed

+279
-672
lines changed

4 files changed

+279
-672
lines changed

Makefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,7 @@ env:
6868
@echo $(TEST_ENV) | tr ' ' '\n' >.env
6969

7070
init: ## Install linters.
71-
go build -modfile=tools/go.mod -o bin/gofumports mvdan.cc/gofumpt/gofumports
72-
go build -modfile=tools/go.mod -o bin/gofumpt mvdan.cc/gofumpt
73-
go build -modfile=tools/go.mod -o bin/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint
74-
go build -modfile=tools/go.mod -o bin/reviewdog github.com/reviewdog/reviewdog/cmd/reviewdog
71+
cd tools && go generate -x -tags=tools
7572

7673
build: ## Compile using plain go build
7774
go build -ldflags="$(GO_BUILD_LDFLAGS)" -o $(PMM_RELEASE_PATH)/mongodb_exporter
@@ -86,8 +83,8 @@ FILES = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
8683

8784
format: ## Format source code.
8885
go mod tidy
89-
bin/gofumpt -w -s $(FILES)
90-
bin/gofumports -local github.com/percona/mongodb_exporter -l -w $(FILES)
86+
bin/gofumpt -l -w -s $(FILES)
87+
bin/goimports -local github.com/percona/mongodb_exporter -l -w $(FILES)
9188

9289
check: ## Run checks/linters
9390
bin/golangci-lint run

tools/go.mod

Lines changed: 67 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,52 @@ module github.com/percona/mongodb_exporter/tools
33
go 1.17
44

55
require (
6-
github.com/golangci/golangci-lint v1.43.0
7-
github.com/reviewdog/reviewdog v0.13.1
6+
github.com/golangci/golangci-lint v1.44.2
7+
github.com/reviewdog/reviewdog v0.14.0
88
golang.org/x/tools v0.1.9
9+
mvdan.cc/gofumpt v0.2.1
910
)
1011

1112
require (
1213
4d63.com/gochecknoglobals v0.1.0 // indirect
13-
cloud.google.com/go v0.99.0 // indirect
14+
cloud.google.com/go v0.100.2 // indirect
15+
cloud.google.com/go/compute v0.1.0 // indirect
1416
cloud.google.com/go/datastore v1.6.0 // indirect
1517
github.com/Antonboom/errname v0.1.5 // indirect
1618
github.com/Antonboom/nilnil v0.1.0 // indirect
17-
github.com/BurntSushi/toml v0.4.1 // indirect
19+
github.com/BurntSushi/toml v1.0.0 // indirect
1820
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect
1921
github.com/Masterminds/semver v1.5.0 // indirect
20-
github.com/OpenPeeDeeP/depguard v1.0.1 // indirect
22+
github.com/OpenPeeDeeP/depguard v1.1.0 // indirect
2123
github.com/alexkohler/prealloc v1.0.0 // indirect
22-
github.com/ashanbrown/forbidigo v1.2.0 // indirect
23-
github.com/ashanbrown/makezero v0.0.0-20210520155254-b6261585ddde // indirect
24+
github.com/ashanbrown/forbidigo v1.3.0 // indirect
25+
github.com/ashanbrown/makezero v1.1.0 // indirect
2426
github.com/beorn7/perks v1.0.1 // indirect
2527
github.com/bkielbasa/cyclop v1.2.0 // indirect
26-
github.com/blizzy78/varnamelen v0.3.0 // indirect
28+
github.com/blizzy78/varnamelen v0.6.0 // indirect
2729
github.com/bombsimon/wsl/v3 v3.3.0 // indirect
28-
github.com/bradleyfalzon/ghinstallation/v2 v2.0.3 // indirect
29-
github.com/breml/bidichk v0.1.1 // indirect
30+
github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 // indirect
31+
github.com/breml/bidichk v0.2.2 // indirect
32+
github.com/breml/errchkjson v0.2.3 // indirect
3033
github.com/butuzov/ireturn v0.1.1 // indirect
3134
github.com/census-instrumentation/opencensus-proto v0.3.0 // indirect
3235
github.com/cespare/xxhash/v2 v2.1.2 // indirect
3336
github.com/charithe/durationcheck v0.0.9 // indirect
3437
github.com/chavacava/garif v0.0.0-20210405164556-e8a0a408d6af // indirect
35-
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403 // indirect
36-
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158 // indirect
37-
github.com/daixiang0/gci v0.2.9 // indirect
38+
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4 // indirect
39+
github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490 // indirect
40+
github.com/daixiang0/gci v0.3.1-0.20220208004058-76d765e3ab48 // indirect
3841
github.com/davecgh/go-spew v1.1.1 // indirect
3942
github.com/denis-tingajkin/go-header v0.4.2 // indirect
40-
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021 // indirect
41-
github.com/envoyproxy/protoc-gen-validate v0.1.0 // indirect
42-
github.com/esimonov/ifshort v1.0.3 // indirect
43+
github.com/envoyproxy/go-control-plane v0.10.1 // indirect
44+
github.com/envoyproxy/protoc-gen-validate v0.6.2 // indirect
45+
github.com/esimonov/ifshort v1.0.4 // indirect
4346
github.com/ettle/strcase v0.1.1 // indirect
4447
github.com/fatih/color v1.13.0 // indirect
4548
github.com/fatih/structtag v1.2.0 // indirect
4649
github.com/fsnotify/fsnotify v1.5.1 // indirect
47-
github.com/fzipp/gocyclo v0.3.1 // indirect
48-
github.com/go-critic/go-critic v0.6.1 // indirect
50+
github.com/fzipp/gocyclo v0.4.0 // indirect
51+
github.com/go-critic/go-critic v0.6.2 // indirect
4952
github.com/go-toolsmith/astcast v1.0.0 // indirect
5053
github.com/go-toolsmith/astcopy v1.0.0 // indirect
5154
github.com/go-toolsmith/astequal v1.0.1 // indirect
@@ -68,120 +71,125 @@ require (
6871
github.com/golangci/misspell v0.3.5 // indirect
6972
github.com/golangci/revgrep v0.0.0-20210930125155-c22e5001d4f2 // indirect
7073
github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect
71-
github.com/google/go-cmp v0.5.6 // indirect
74+
github.com/google/go-cmp v0.5.7 // indirect
7275
github.com/google/go-github/v39 v39.2.0 // indirect
76+
github.com/google/go-github/v41 v41.0.0 // indirect
7377
github.com/google/go-querystring v1.1.0 // indirect
7478
github.com/googleapis/gax-go/v2 v2.1.1 // indirect
7579
github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8 // indirect
7680
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect
7781
github.com/gostaticanalysis/comment v1.4.2 // indirect
7882
github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect
7983
github.com/gostaticanalysis/nilerr v0.1.1 // indirect
80-
github.com/hashicorp/errwrap v1.1.0 // indirect
84+
github.com/hashicorp/errwrap v1.0.0 // indirect
8185
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
8286
github.com/hashicorp/go-multierror v1.1.1 // indirect
83-
github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
87+
github.com/hashicorp/go-retryablehttp v0.6.8 // indirect
8488
github.com/hashicorp/hcl v1.0.0 // indirect
8589
github.com/haya14busa/go-actions-toolkit v0.0.0-20200105081403-ca0307860f01 // indirect
90+
github.com/hexops/gotextdiff v1.0.3 // indirect
8691
github.com/inconshreveable/mousetrap v1.0.0 // indirect
8792
github.com/jgautheron/goconst v1.5.1 // indirect
8893
github.com/jingyugao/rowserrcheck v1.1.1 // indirect
8994
github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect
90-
github.com/julz/importas v0.0.0-20210922140945-27e0a5d4dee2 // indirect
95+
github.com/julz/importas v0.1.0 // indirect
9196
github.com/kisielk/errcheck v1.6.0 // indirect
9297
github.com/kisielk/gotool v1.0.0 // indirect
93-
github.com/kulti/thelper v0.4.0 // indirect
98+
github.com/kulti/thelper v0.5.1 // indirect
9499
github.com/kunwardeep/paralleltest v1.0.3 // indirect
95100
github.com/kyoh86/exportloopref v0.1.8 // indirect
96101
github.com/ldez/gomoddirectives v0.2.2 // indirect
97-
github.com/ldez/tagliatelle v0.2.0 // indirect
102+
github.com/ldez/tagliatelle v0.3.1 // indirect
103+
github.com/leonklingele/grouper v1.1.0 // indirect
98104
github.com/magiconair/properties v1.8.5 // indirect
99105
github.com/maratori/testpackage v1.0.1 // indirect
100106
github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 // indirect
101-
github.com/mattn/go-colorable v0.1.11 // indirect
107+
github.com/mattn/go-colorable v0.1.12 // indirect
102108
github.com/mattn/go-isatty v0.0.14 // indirect
103-
github.com/mattn/go-runewidth v0.0.13 // indirect
109+
github.com/mattn/go-runewidth v0.0.9 // indirect
104110
github.com/mattn/go-shellwords v1.0.12 // indirect
105111
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
106112
github.com/mbilski/exhaustivestruct v1.2.0 // indirect
107113
github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517 // indirect
108-
github.com/mgechev/revive v1.1.2 // indirect
114+
github.com/mgechev/revive v1.1.4 // indirect
109115
github.com/mitchellh/go-homedir v1.1.0 // indirect
110-
github.com/mitchellh/mapstructure v1.4.2 // indirect
116+
github.com/mitchellh/mapstructure v1.4.3 // indirect
111117
github.com/moricho/tparallel v0.2.1 // indirect
112118
github.com/nakabonne/nestif v0.3.1 // indirect
113119
github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 // indirect
114-
github.com/nishanths/exhaustive v0.2.3 // indirect
120+
github.com/nishanths/exhaustive v0.7.11 // indirect
115121
github.com/nishanths/predeclared v0.2.1 // indirect
116122
github.com/olekukonko/tablewriter v0.0.5 // indirect
117123
github.com/pelletier/go-toml v1.9.4 // indirect
118124
github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d // indirect
119125
github.com/pkg/errors v0.9.1 // indirect
120126
github.com/pmezard/go-difflib v1.0.0 // indirect
121-
github.com/polyfloyd/go-errorlint v0.0.0-20210903085826-e4f368f0ae69 // indirect
122-
github.com/prometheus/client_golang v1.11.0 // indirect
127+
github.com/polyfloyd/go-errorlint v0.0.0-20211125173453-6d6d39c5bb8b // indirect
128+
github.com/prometheus/client_golang v1.7.1 // indirect
123129
github.com/prometheus/client_model v0.2.0 // indirect
124-
github.com/prometheus/common v0.31.1 // indirect
125-
github.com/prometheus/procfs v0.7.3 // indirect
126-
github.com/quasilyte/go-ruleguard v0.3.13 // indirect
127-
github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect
130+
github.com/prometheus/common v0.10.0 // indirect
131+
github.com/prometheus/procfs v0.6.0 // indirect
132+
github.com/quasilyte/go-ruleguard v0.3.15 // indirect
133+
github.com/quasilyte/gogrep v0.0.0-20220103110004-ffaa07af02e3 // indirect
134+
github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95 // indirect
128135
github.com/reva2/bitbucket-insights-api v1.0.0 // indirect
129-
github.com/reviewdog/errorformat v0.0.0-20210809090836-cda72036d1df // indirect
136+
github.com/reviewdog/errorformat v0.0.0-20220211042446-3cbfabf46dbd // indirect
130137
github.com/reviewdog/go-bitbucket v0.0.0-20201024094602-708c3f6a7de0 // indirect
131-
github.com/rivo/uniseg v0.2.0 // indirect
132138
github.com/ryancurrah/gomodguard v1.2.3 // indirect
133139
github.com/ryanrolds/sqlclosecheck v0.3.0 // indirect
134-
github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect
135-
github.com/securego/gosec/v2 v2.9.1 // indirect
140+
github.com/sanposhiho/wastedassign/v2 v2.0.6 // indirect
141+
github.com/securego/gosec/v2 v2.9.6 // indirect
136142
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect
137143
github.com/sirupsen/logrus v1.8.1 // indirect
144+
github.com/sivchari/containedctx v1.0.1 // indirect
138145
github.com/sivchari/tenv v1.4.7 // indirect
139146
github.com/sonatard/noctx v0.0.1 // indirect
140147
github.com/sourcegraph/go-diff v0.6.1 // indirect
141148
github.com/spf13/afero v1.6.0 // indirect
142149
github.com/spf13/cast v1.4.1 // indirect
143-
github.com/spf13/cobra v1.2.1 // indirect
150+
github.com/spf13/cobra v1.3.0 // indirect
144151
github.com/spf13/jwalterweatherman v1.1.0 // indirect
145152
github.com/spf13/pflag v1.0.5 // indirect
146-
github.com/spf13/viper v1.9.0 // indirect
153+
github.com/spf13/viper v1.10.1 // indirect
147154
github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect
148-
github.com/stretchr/objx v0.3.0 // indirect
155+
github.com/stretchr/objx v0.1.1 // indirect
149156
github.com/stretchr/testify v1.7.0 // indirect
150157
github.com/subosito/gotenv v1.2.0 // indirect
151158
github.com/sylvia7788/contextcheck v1.0.4 // indirect
152-
github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b // indirect
159+
github.com/tdakkota/asciicheck v0.1.1 // indirect
153160
github.com/tetafro/godot v1.4.11 // indirect
154161
github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144 // indirect
155162
github.com/tomarrell/wrapcheck/v2 v2.4.0 // indirect
156-
github.com/tommy-muehle/go-mnd/v2 v2.4.0 // indirect
163+
github.com/tommy-muehle/go-mnd/v2 v2.5.0 // indirect
157164
github.com/ultraware/funlen v0.0.3 // indirect
158-
github.com/ultraware/whitespace v0.0.4 // indirect
165+
github.com/ultraware/whitespace v0.0.5 // indirect
159166
github.com/uudashr/gocognit v1.0.5 // indirect
160167
github.com/vvakame/sdlog v0.0.0-20200409072131-7c0d359efddc // indirect
161-
github.com/xanzy/go-gitlab v0.52.2 // indirect
162-
github.com/yeya24/promlinter v0.1.0 // indirect
168+
github.com/xanzy/go-gitlab v0.55.0 // indirect
169+
github.com/yagipy/maintidx v1.0.0 // indirect
170+
github.com/yeya24/promlinter v0.1.1-0.20210918184747-d757024714a1 // indirect
171+
gitlab.com/bosi/decorder v0.2.1 // indirect
163172
go.opencensus.io v0.23.0 // indirect
164-
golang.org/x/build v0.0.0-20211001051633-80b982a6bd67 // indirect
165-
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
173+
golang.org/x/build v0.0.0-20200616162219-07bebbe343e9 // indirect
174+
golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce // indirect
166175
golang.org/x/mod v0.5.1 // indirect
167-
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect
176+
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
168177
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
169178
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
170-
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881 // indirect
179+
golang.org/x/sys v0.0.0-20220111092808-5a964db01320 // indirect
171180
golang.org/x/text v0.3.7 // indirect
172-
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
181+
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect
173182
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
174-
google.golang.org/api v0.61.0 // indirect
183+
google.golang.org/api v0.63.0 // indirect
175184
google.golang.org/appengine v1.6.7 // indirect
176-
google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0 // indirect
177-
google.golang.org/grpc v1.41.0 // indirect
185+
google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c // indirect
186+
google.golang.org/grpc v1.43.0 // indirect
178187
google.golang.org/protobuf v1.27.1 // indirect
179-
gopkg.in/ini.v1 v1.63.2 // indirect
188+
gopkg.in/ini.v1 v1.66.2 // indirect
180189
gopkg.in/yaml.v2 v2.4.0 // indirect
181190
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
182-
honnef.co/go/tools v0.2.1 // indirect
183-
mvdan.cc/gofumpt v0.1.1 // indirect
191+
honnef.co/go/tools v0.2.2 // indirect
184192
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect
185193
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect
186-
mvdan.cc/unparam v0.0.0-20211002134041-24922b6997ca // indirect
194+
mvdan.cc/unparam v0.0.0-20211214103731-d0ef000c54e5 // indirect
187195
)

0 commit comments

Comments
 (0)