mirror of
https://codeberg.org/superseriousbusiness/gotosocial.git
synced 2024-12-25 18:38:17 +03:00
6c0d93c6cb
* [chore]: Bump github.com/prometheus/client_golang from 1.18.0 to 1.19.1 Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.18.0 to 1.19.1. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.18.0...v1.19.1) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [chore]: Bump github.com/KimMachineGun/automemlimit from 0.6.0 to 0.6.1 Bumps [github.com/KimMachineGun/automemlimit](https://github.com/KimMachineGun/automemlimit) from 0.6.0 to 0.6.1. - [Release notes](https://github.com/KimMachineGun/automemlimit/releases) - [Commits](https://github.com/KimMachineGun/automemlimit/compare/v0.6.0...v0.6.1) --- updated-dependencies: - dependency-name: github.com/KimMachineGun/automemlimit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * [chore]: Bump github.com/tdewolff/minify/v2 from 2.20.20 to 2.20.24 Bumps [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) from 2.20.20 to 2.20.24. - [Release notes](https://github.com/tdewolff/minify/releases) - [Commits](https://github.com/tdewolff/minify/compare/v2.20.20...v2.20.24) --- updated-dependencies: - dependency-name: github.com/tdewolff/minify/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * [chore]: Bump github.com/go-swagger/go-swagger Bumps [github.com/go-swagger/go-swagger](https://github.com/go-swagger/go-swagger) from 0.30.6-0.20240418033037-c46c303aaa02 to 0.31.0. - [Release notes](https://github.com/go-swagger/go-swagger/releases) - [Changelog](https://github.com/go-swagger/go-swagger/blob/master/.goreleaser.yml) - [Commits](https://github.com/go-swagger/go-swagger/commits/v0.31.0) --- updated-dependencies: - dependency-name: github.com/go-swagger/go-swagger dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [chore]: Bump github.com/gin-gonic/gin from 1.9.1 to 1.10.0 Bumps [github.com/gin-gonic/gin](https://github.com/gin-gonic/gin) from 1.9.1 to 1.10.0. - [Release notes](https://github.com/gin-gonic/gin/releases) - [Changelog](https://github.com/gin-gonic/gin/blob/master/CHANGELOG.md) - [Commits](https://github.com/gin-gonic/gin/compare/v1.9.1...v1.10.0) --- updated-dependencies: - dependency-name: github.com/gin-gonic/gin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
78 lines
2 KiB
Makefile
78 lines
2 KiB
Makefile
GO ?= go
|
|
GOFMT ?= gofmt "-s"
|
|
GO_VERSION=$(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
|
|
PACKAGES ?= $(shell $(GO) list ./...)
|
|
VETPACKAGES ?= $(shell $(GO) list ./... | grep -v /examples/)
|
|
GOFILES := $(shell find . -name "*.go")
|
|
TESTFOLDER := $(shell $(GO) list ./... | grep -E 'gin$$|binding$$|render$$' | grep -v examples)
|
|
TESTTAGS ?= ""
|
|
|
|
.PHONY: test
|
|
test:
|
|
echo "mode: count" > coverage.out
|
|
for d in $(TESTFOLDER); do \
|
|
$(GO) test $(TESTTAGS) -v -covermode=count -coverprofile=profile.out $$d > tmp.out; \
|
|
cat tmp.out; \
|
|
if grep -q "^--- FAIL" tmp.out; then \
|
|
rm tmp.out; \
|
|
exit 1; \
|
|
elif grep -q "build failed" tmp.out; then \
|
|
rm tmp.out; \
|
|
exit 1; \
|
|
elif grep -q "setup failed" tmp.out; then \
|
|
rm tmp.out; \
|
|
exit 1; \
|
|
fi; \
|
|
if [ -f profile.out ]; then \
|
|
cat profile.out | grep -v "mode:" >> coverage.out; \
|
|
rm profile.out; \
|
|
fi; \
|
|
done
|
|
|
|
.PHONY: fmt
|
|
fmt:
|
|
$(GOFMT) -w $(GOFILES)
|
|
|
|
.PHONY: fmt-check
|
|
fmt-check:
|
|
@diff=$$($(GOFMT) -d $(GOFILES)); \
|
|
if [ -n "$$diff" ]; then \
|
|
echo "Please run 'make fmt' and commit the result:"; \
|
|
echo "$${diff}"; \
|
|
exit 1; \
|
|
fi;
|
|
|
|
.PHONY: vet
|
|
vet:
|
|
$(GO) vet $(VETPACKAGES)
|
|
|
|
.PHONY: lint
|
|
lint:
|
|
@hash golint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
|
$(GO) get -u golang.org/x/lint/golint; \
|
|
fi
|
|
for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done;
|
|
|
|
.PHONY: misspell-check
|
|
misspell-check:
|
|
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
|
$(GO) get -u github.com/client9/misspell/cmd/misspell; \
|
|
fi
|
|
misspell -error $(GOFILES)
|
|
|
|
.PHONY: misspell
|
|
misspell:
|
|
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
|
$(GO) get -u github.com/client9/misspell/cmd/misspell; \
|
|
fi
|
|
misspell -w $(GOFILES)
|
|
|
|
.PHONY: tools
|
|
tools:
|
|
@if [ $(GO_VERSION) -gt 15 ]; then \
|
|
$(GO) install golang.org/x/lint/golint@latest; \
|
|
$(GO) install github.com/client9/misspell/cmd/misspell@latest; \
|
|
elif [ $(GO_VERSION) -lt 16 ]; then \
|
|
$(GO) install golang.org/x/lint/golint; \
|
|
$(GO) install github.com/client9/misspell/cmd/misspell; \
|
|
fi
|