diff --git a/Makefile b/Makefile index 750fe188f1..1209b2fe32 100644 --- a/Makefile +++ b/Makefile @@ -106,6 +106,9 @@ fmt: fix: build $(GOBIN)/algofix */ +modernize: + go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -category minmax,slicescontains,sortslice,stringscutprefix,mapsloop -fix -test ./... + lint: deps $(GOBIN)/golangci-lint run -c .golangci.yml @@ -129,7 +132,7 @@ tidy: check_go_version check_shell: find . -type f -name "*.sh" -exec shellcheck {} + -sanity: fix lint fmt tidy +sanity: fix lint fmt tidy modernize cover: go test $(GOTAGS) -coverprofile=cover.out $(UNIT_TEST_SOURCES) @@ -412,7 +415,7 @@ dump: $(addprefix gen/,$(addsuffix /genesis.dump, $(NETWORKS))) install: build scripts/dev_install.sh -p $(GOBIN) -.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 +.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 ###### TARGETS FOR CICD PROCESS ###### include ./scripts/release/mule/Makefile.mule diff --git a/scripts/travis/codegen_verification.sh b/scripts/travis/codegen_verification.sh index 934379b5b8..393f8e6965 100755 --- a/scripts/travis/codegen_verification.sh +++ b/scripts/travis/codegen_verification.sh @@ -36,6 +36,9 @@ make generate echo "Running fixcheck" "$GOPATH"/bin/algofix -error */ +echo "Running modernize checks" +make modernize + echo "Running expect linter" make expectlint