summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorW. Trevor King <wking@tremily.us>2018-07-02 08:45:06 -0700
committerAtomic Bot <atomic-devel@projectatomic.io>2018-07-03 10:39:54 +0000
commit7a5c376e63085d60a5d9c00d8f176b4a945f1ad0 (patch)
tree059b7d453ed2785d73edc41fe462ebe0b1fb06ff /Makefile
parent40e4481bd8e0d699aa4f05f59e92d457f594a01f (diff)
downloadpodman-7a5c376e63085d60a5d9c00d8f176b4a945f1ad0.tar.gz
podman-7a5c376e63085d60a5d9c00d8f176b4a945f1ad0.tar.bz2
podman-7a5c376e63085d60a5d9c00d8f176b4a945f1ad0.zip
Makefile: Use 'git diff' to show gofmt changes
This makes fixing errors easier. Before this commit, errors looked like [1]: $ make gofmt libpod/container_linux.go:1::warning: file is not gofmted with -s (gofmt) make: *** [gofmt] Error 1 But that's not very helpful when your local gofmt thinks the file is fine. With this commit, errors will look like: $ make gofmt find . -name '*.go' ! -path './vendor/*' -exec gofmt -s -w {} \+ git diff --exit-code diff --git a/libpod/container_internal.go b/libpod/container_internal.go index df4de3fe..22b39870 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -1,7 +1,7 @@ package libpod import ( -"bytes" + "bytes" "context" "encoding/json" "fmt" make: *** [Makefile:87: gofmt] Error 1 (or whatever, I just stuffed in a formatting error for demonstration purposes). Also remove the helper script in favor of direct Makefile calls, because with Git handling difference reporting and exit status, this becomes a simpler check. find's -exec, !, and -path arguments are specified in POSIX [2]. [1]: https://travis-ci.org/kubernetes-incubator/cri-o/jobs/331949394#L1075 [2]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/find.html Signed-off-by: W. Trevor King <wking@tremily.us> Closes: #1038 Approved by: rhatdan
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 2 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 870ab9851..9a72c6603 100644
--- a/Makefile
+++ b/Makefile
@@ -83,10 +83,8 @@ lint: .gopathok varlink_generate
@./.tool/lint
gofmt:
- @./hack/verify-gofmt.sh
-
-fix_gofmt:
- @./hack/verify-gofmt.sh -f
+ find . -name '*.go' ! -path './vendor/*' -exec gofmt -s -w {} \+
+ git diff --exit-code
test/bin2img/bin2img: .gopathok $(wildcard test/bin2img/*.go)
$(GO) build -ldflags '$(LDFLAGS)' -tags "$(BUILDTAGS) containers_image_ostree_stub" -o $@ $(PROJECT)/test/bin2img