From e8003af3cd7b7a08f8e34233e2071a70245b3c69 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Wed, 24 Oct 2018 19:06:58 -0700 Subject: [PATCH] make: ensure make fmt is run with -s flag Linting will fail if code is not formatted with the -s flag, so make sure we always use it when formatting. --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 448b26f4..cf1d5403 100644 --- a/Makefile +++ b/Makefile @@ -36,14 +36,13 @@ GOBUILD := go build -v GOINSTALL := go install -v GOTEST := go test -v -GOLIST := go list $(PKG)/... | grep -v '/vendor/' +GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*") GOLISTCOVER := $(shell go list -f '{{.ImportPath}}' ./... | sed -e 's/^$(ESCPKG)/./') GOLISTLINT := $(shell go list -f '{{.Dir}}' ./... | grep -v 'lnrpc') RM := rm -f CP := cp MAKE := make -XARGS := xargs -L 1 include make/testing_flags.mk @@ -211,7 +210,7 @@ endif fmt: @$(call print, "Formatting source.") - $(GOLIST) | $(XARGS) go fmt -x + gofmt -l -w -s $(GOFILES_NOVENDOR) lint: $(LINT_BIN) @$(call print, "Linting source.")