Skip to content

Commit

Permalink
chore: Bump gofumpt to version 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Dec 17, 2021
1 parent d4bef1a commit bb4ce3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
env:
AGE_VERSION: 1.0.0
GO_VERSION: 1.17.5
GOFUMPT_VERSION: 0.2.1
GOLANGCI_LINT_VERSION: 1.43.0
jobs:
changes:
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
GO?=go
GOLANGCI_LINT_VERSION=$(shell grep GOLANGCI_LINT_VERSION: .github/workflows/main.yml | awk '{ print $$2 }')
GOFUMPT_VERSION=$(shell awk '/GOFUMPT_VERSION:/ { print $$2 }' .github/workflows/main.yml)
GOLANGCI_LINT_VERSION=$(shell awk '/GOLANGCI_LINT_VERSION:/ { print $$2 }' .github/workflows/main.yml)
ifdef VERSION
GO_LDFLAGS+=-X main.version=${VERSION}
endif
Expand Down Expand Up @@ -103,16 +104,16 @@ lint: ensure-golangci-lint

.PHONY: format
format: ensure-gofumpt
find . -name \*.go | xargs ./bin/gofumpt -w
find . -name \*.go | xargs ./bin/gofumpt -extra -w

.PHONY: ensure-tools
ensure-tools: ensure-gofumpt ensure-golangci-lint

.PHONY: ensure-gofumpt
ensure-gofumpt:
if [ ! -x bin/gofumpt ] ; then \
if [ ! -x bin/gofumpt ] || ( ./bin/gofumpt --version | grep -Fqv "v${GOFUMPT_VERSION}" ) ; then \
mkdir -p bin ; \
GOBIN=$(shell pwd)/bin ${GO} install mvdan.cc/gofumpt@v0.2.0 ; \
GOBIN=$(shell pwd)/bin ${GO} install "mvdan.cc/gofumpt@v${GOFUMPT_VERSION}" ; \
fi

.PHONY: ensure-golangci-lint
Expand Down

0 comments on commit bb4ce3c

Please sign in to comment.