Skip to content

Commit 4c599ad

Browse files
authored
task: go tools (#3875)
1 parent 64a88e8 commit 4c599ad

File tree

12 files changed

+550
-77
lines changed

12 files changed

+550
-77
lines changed

.github/workflows/autoupdate-sdk.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
- uses: actions/setup-go@v5
1616
with:
1717
go-version-file: 'go.mod'
18-
- run: go install github.com/icholy/gomajor@latest
1918
- id: version
2019
run: echo "VERSION=$(curl -sSfL -X GET https://api.github.com/repos/mongodb/atlas-sdk-go/releases/latest | jq -r '.tag_name')" >> "$GITHUB_OUTPUT"
2120
- run: make update-atlas-sdk

.github/workflows/code-health.yml

-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@ jobs:
311311
uses: actions/setup-go@v5
312312
with:
313313
go-version-file: 'go.mod'
314-
- run: make devtools
315314
- run: ./build/ci/check-licenses.sh
316315
checktemplates:
317316
name: checktemplates

Makefile

+1-11
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,7 @@ deps: ## Download go module dependencies
6868
.PHONY: devtools
6969
devtools: ## Install dev tools
7070
@echo "==> Installing dev tools..."
71-
go install github.com/google/addlicense@latest
7271
go install go.uber.org/mock/mockgen@latest
73-
go install golang.org/x/tools/cmd/goimports@latest
74-
go install github.com/google/go-licenses@latest
75-
go install mvdan.cc/sh/v3/cmd/shfmt@latest
76-
go install github.com/icholy/gomajor@latest
7772
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin $(GOLANGCI_VERSION)
7873

7974
.PHONY: setup
@@ -87,12 +82,7 @@ link-git-hooks: ## Install git hooks
8782

8883
.PHONY: fmt
8984
fmt: ## Format changed go
90-
@scripts/fmt.sh
91-
92-
.PHONY: fmt-all
93-
fmt-all: ### Format all go files with goimports and gofmt
94-
find . -name "*.go" -not -path "./vendor/*" -not -path "./internal/mocks" -exec gofmt -w "{}" \;
95-
find . -name "*.go" -not -path "./vendor/*" -not -path "./internal/mocks" -exec goimports -l -w "{}" \;
85+
golangci-lint fmt
9686

9787
.PHONY: test
9888
test: unit-test

build/ci/check-licenses.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ find_files() {
2727
}
2828

2929
for FILE in $(find_files); do
30-
addlicense -c "MongoDB Inc" -check "${FILE}"
30+
go tool addlicense -c "MongoDB Inc" -check "${FILE}"
3131
done

build/ci/library_owners.json

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"go.opentelemetry.io/otel/sdk": "apix-2",
4949
"go.opentelemetry.io/otel/trace": "apix-2",
5050
"go.uber.org/mock": "apix-2",
51-
"golang.org/x/exp": "apix-2",
5251
"golang.org/x/mod": "apix-2",
5352
"golang.org/x/net": "apix-2",
5453
"golang.org/x/sys": "apix-2",

build/package/generate-notices.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
set -Eeou pipefail
1818

19-
go install github.com/google/go-licenses@latest
20-
21-
go-licenses save "github.com/mongodb/mongodb-atlas-cli/atlascli/cmd/atlas" --save_path=third_party_notices
19+
go tool go-licenses save "github.com/mongodb/mongodb-atlas-cli/atlascli/cmd/atlas" --save_path=third_party_notices
2220
# For HCL, a dependency of viper, go-license adds the source code with restricted permissions, this is a problem for some linux users
2321
sudo chmod -R 755 ./third_party_notices

go.mod

+29-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ require (
2020
github.com/briandowns/spinner v1.23.2
2121
github.com/creack/pty v1.1.24
2222
github.com/denisbrodbeck/machineid v1.0.1
23-
github.com/evergreen-ci/shrub v0.0.0-20241002130202-d2f0f3752474
23+
github.com/evergreen-ci/shrub v0.0.0-20250506131348-39cf0eb2b3dc
2424
github.com/getkin/kin-openapi v0.132.0
2525
github.com/go-test/deep v1.1.1
2626
github.com/golang-jwt/jwt/v5 v5.2.2
@@ -51,7 +51,6 @@ require (
5151
go.opentelemetry.io/otel/sdk v1.35.0
5252
go.opentelemetry.io/otel/trace v1.35.0
5353
go.uber.org/mock v0.5.2
54-
golang.org/x/exp v0.0.0-20241004190924-225e2abe05e6
5554
golang.org/x/mod v0.24.0
5655
golang.org/x/net v0.40.0
5756
golang.org/x/sys v0.33.0
@@ -62,6 +61,28 @@ require (
6261
gopkg.in/yaml.v3 v3.0.1
6362
)
6463

64+
require (
65+
github.com/bmatcuk/doublestar/v4 v4.0.2 // indirect
66+
github.com/emirpasic/gods v1.12.0 // indirect
67+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
68+
github.com/google/addlicense v1.1.1 // indirect
69+
github.com/google/go-licenses v1.6.0 // indirect
70+
github.com/google/licenseclassifier v0.0.0-20210722185704-3043a050f148 // indirect
71+
github.com/icholy/gomajor v0.14.0 // indirect
72+
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
73+
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
74+
github.com/mitchellh/go-homedir v1.1.0 // indirect
75+
github.com/otiai10/copy v1.6.0 // indirect
76+
github.com/sergi/go-diff v1.2.0 // indirect
77+
github.com/src-d/gcfg v1.4.0 // indirect
78+
github.com/xanzy/ssh-agent v0.2.1 // indirect
79+
go.opencensus.io v0.24.0 // indirect
80+
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect
81+
gopkg.in/src-d/go-git.v4 v4.13.1 // indirect
82+
gopkg.in/warnings.v0 v0.1.2 // indirect
83+
k8s.io/klog/v2 v2.80.1 // indirect
84+
)
85+
6586
require (
6687
cloud.google.com/go v0.120.0 // indirect
6788
cloud.google.com/go/auth v0.16.1 // indirect
@@ -169,3 +190,9 @@ require (
169190
google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e // indirect
170191
google.golang.org/genproto/googleapis/rpc v0.0.0-20250425173222-7b384671a197 // indirect
171192
)
193+
194+
tool (
195+
github.com/google/addlicense
196+
github.com/google/go-licenses
197+
github.com/icholy/gomajor
198+
)

0 commit comments

Comments
 (0)