summaryrefslogtreecommitdiffstats
path: root/vendor/go.uber.org/atomic/Makefile
diff options
context:
space:
mode:
authorWim <wim@42.be>2020-12-31 14:48:12 +0100
committerGitHub <noreply@github.com>2020-12-31 14:48:12 +0100
commit4f20ebead36876a88391bf033d1de3e4cf0228da (patch)
tree70b6fd79c6a5e00c958c29a7bd3926f074e76ba6 /vendor/go.uber.org/atomic/Makefile
parenta9f89dbc645aafc68daa9fc8d589f55104b535c7 (diff)
downloadmatterbridge-msglm-4f20ebead36876a88391bf033d1de3e4cf0228da.tar.gz
matterbridge-msglm-4f20ebead36876a88391bf033d1de3e4cf0228da.tar.bz2
matterbridge-msglm-4f20ebead36876a88391bf033d1de3e4cf0228da.zip
Update vendor for next release (#1343)
Diffstat (limited to 'vendor/go.uber.org/atomic/Makefile')
-rw-r--r--vendor/go.uber.org/atomic/Makefile51
1 files changed, 47 insertions, 4 deletions
diff --git a/vendor/go.uber.org/atomic/Makefile b/vendor/go.uber.org/atomic/Makefile
index 39af0fb6..1b1376d4 100644
--- a/vendor/go.uber.org/atomic/Makefile
+++ b/vendor/go.uber.org/atomic/Makefile
@@ -2,8 +2,16 @@
export GOBIN ?= $(shell pwd)/bin
GOLINT = $(GOBIN)/golint
+GEN_ATOMICINT = $(GOBIN)/gen-atomicint
+GEN_ATOMICWRAPPER = $(GOBIN)/gen-atomicwrapper
+STATICCHECK = $(GOBIN)/staticcheck
-GO_FILES ?= *.go
+GO_FILES ?= $(shell find . '(' -path .git -o -path vendor ')' -prune -o -name '*.go' -print)
+
+# Also update ignore section in .codecov.yml.
+COVER_IGNORE_PKGS = \
+ go.uber.org/atomic/internal/gen-atomicint \
+ go.uber.org/atomic/internal/gen-atomicwrapper
.PHONY: build
build:
@@ -20,16 +28,51 @@ gofmt:
@[ ! -s "$(FMT_LOG)" ] || (echo "gofmt failed:" && cat $(FMT_LOG) && false)
$(GOLINT):
- go install golang.org/x/lint/golint
+ cd tools && go install golang.org/x/lint/golint
+
+$(STATICCHECK):
+ cd tools && go install honnef.co/go/tools/cmd/staticcheck
+
+$(GEN_ATOMICWRAPPER): $(wildcard ./internal/gen-atomicwrapper/*)
+ go build -o $@ ./internal/gen-atomicwrapper
+
+$(GEN_ATOMICINT): $(wildcard ./internal/gen-atomicint/*)
+ go build -o $@ ./internal/gen-atomicint
.PHONY: golint
golint: $(GOLINT)
$(GOLINT) ./...
+.PHONY: staticcheck
+staticcheck: $(STATICCHECK)
+ $(STATICCHECK) ./...
+
.PHONY: lint
-lint: gofmt golint
+lint: gofmt golint staticcheck generatenodirty
+
+# comma separated list of packages to consider for code coverage.
+COVER_PKG = $(shell \
+ go list -find ./... | \
+ grep -v $(foreach pkg,$(COVER_IGNORE_PKGS),-e "^$(pkg)$$") | \
+ paste -sd, -)
.PHONY: cover
cover:
- go test -coverprofile=cover.out -coverpkg ./... -v ./...
+ go test -coverprofile=cover.out -coverpkg $(COVER_PKG) -v ./...
go tool cover -html=cover.out -o cover.html
+
+.PHONY: generate
+generate: $(GEN_ATOMICINT) $(GEN_ATOMICWRAPPER)
+ go generate ./...
+
+.PHONY: generatenodirty
+generatenodirty:
+ @[ -z "$$(git status --porcelain)" ] || ( \
+ echo "Working tree is dirty. Commit your changes first."; \
+ exit 1 )
+ @make generate
+ @status=$$(git status --porcelain); \
+ [ -z "$$status" ] || ( \
+ echo "Working tree is dirty after `make generate`:"; \
+ echo "$$status"; \
+ echo "Please ensure that the generated code is up-to-date." )