github.com/stripe/stripe-go/v76@v76.25.0/Makefile (about) 1 all: test bench vet lint check-api-clients check-gofmt ci-test 2 3 bench: 4 go test -race -bench . -run "Benchmark" ./form 5 6 build: 7 go build ./... 8 9 check-api-clients: 10 go run scripts/check_api_clients/main.go 11 12 check-gofmt: 13 scripts/gofmt.sh check 14 15 lint: 16 staticcheck 17 18 test: 19 go run scripts/test_with_stripe_mock/main.go -race ./... 20 21 ci-test: test bench check-api-clients 22 vet: 23 go vet ./... 24 25 coverage: 26 go run scripts/test_with_stripe_mock/main.go -covermode=count -coverprofile=combined.coverprofile ./... 27 28 coveralls: 29 go install github.com/mattn/goveralls@latest && $(HOME)/go/bin/goveralls -service=github -coverprofile=combined.coverprofile 30 31 clean: 32 find . -name \*.coverprofile -delete 33 34 MAJOR_VERSION := $(shell echo $(VERSION) | sed 's/\..*//') 35 update-version: 36 @echo "$(VERSION)" > VERSION 37 @perl -pi -e 's|const clientversion = "[.\d\-\w]+"|const clientversion = "$(VERSION)"|' stripe.go 38 @perl -pi -e 's|github.com/stripe/stripe-go/v\d+|github.com/stripe/stripe-go/v$(MAJOR_VERSION)|' README.md 39 $(MAKE) normalize-imports 40 41 codegen-format: normalize-imports 42 scripts/gofmt.sh 43 go install golang.org/x/tools/cmd/goimports@latest && goimports -w example/generated_examples_test.go 44 45 CURRENT_MAJOR_VERSION := $(shell cat VERSION | sed 's/\..*//') 46 normalize-imports: 47 @perl -pi -e 's|github.com/stripe/stripe-go/v\d+|github.com/stripe/stripe-go/v$(CURRENT_MAJOR_VERSION)|' go.mod 48 @find . -name '*.go' -exec perl -pi -e 's|github.com/stripe/stripe-go/(v\d+\|\[MAJOR_VERSION\])|github.com/stripe/stripe-go/v$(CURRENT_MAJOR_VERSION)|' {} + 49 50 .PHONY: codegen-format update-version normalize-imports