Skip to content

Commit 8245ed1

Browse files
authored
CI: add make modernize target & add to codegen verification (algorand#6439)
1 parent 988c7d3 commit 8245ed1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ fmt:
106106
fix: build
107107
$(GOBIN)/algofix */
108108

109+
modernize:
110+
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -category minmax,slicescontains,sortslice,stringscutprefix,mapsloop -fix -test ./...
111+
109112
lint: deps
110113
$(GOBIN)/golangci-lint run -c .golangci.yml
111114

@@ -129,7 +132,7 @@ tidy: check_go_version
129132
check_shell:
130133
find . -type f -name "*.sh" -exec shellcheck {} +
131134

132-
sanity: fix lint fmt tidy
135+
sanity: fix lint fmt tidy modernize
133136

134137
cover:
135138
go test $(GOTAGS) -coverprofile=cover.out $(UNIT_TEST_SOURCES)
@@ -412,7 +415,7 @@ dump: $(addprefix gen/,$(addsuffix /genesis.dump, $(NETWORKS)))
412415
install: build
413416
scripts/dev_install.sh -p $(GOBIN)
414417

415-
.PHONY: default fmt lint check_shell sanity cover prof deps build build-race build-e2e test fulltest shorttest clean cleango deploy node_exporter install %gen gen NONGO_BIN check-go-version rebuild_kmd_swagger universal libsodium
418+
.PHONY: default fmt lint check_shell sanity cover prof deps build build-race build-e2e test fulltest shorttest clean cleango deploy node_exporter install %gen gen NONGO_BIN check-go-version rebuild_kmd_swagger universal libsodium modernize
416419

417420
###### TARGETS FOR CICD PROCESS ######
418421
include ./scripts/release/mule/Makefile.mule

scripts/travis/codegen_verification.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ make generate
3636
echo "Running fixcheck"
3737
"$GOPATH"/bin/algofix -error */
3838

39+
echo "Running modernize checks"
40+
make modernize
41+
3942
echo "Running expect linter"
4043
make expectlint
4144

0 commit comments

Comments
 (0)