Skip to content

Commit 6ae165b

Browse files
committed
fmt with golines
1 parent ee26b3d commit 6ae165b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ PKGS := $(PKG_ERR2) $(PKG_ASSERT) $(PKG_TRY) $(PKG_DEBUG) $(PKG_HANDLER) $(PKG_S
1111

1212
SRCDIRS := $(shell go list -f '{{.Dir}}' $(PKGS))
1313

14+
MAX_LINE ?= 80
1415
GO ?= go
1516
TEST_ARGS ?= -benchmem
1617
# -"gcflags '-N -l'" both optimization & inlining disabled
@@ -106,6 +107,12 @@ bench_x:
106107
vet: | test
107108
$(GO) vet $(PKGS)
108109

110+
fmt:
111+
@golines -t 5 -w -m $(MAX_LINE) --ignore-generated .
112+
113+
dry-fmt:
114+
@golines -t 5 --dry-run -m $(MAX_LINE) --ignore-generated .
115+
109116
gofmt:
110117
@echo Checking code is gofmted
111118
@test -z "$(shell gofmt -s -l -d -e $(SRCDIRS) | tee /dev/stderr)"

0 commit comments

Comments
 (0)