Files
skopeo/tests/validate/gofmt.sh
Nalin Dahyabhai c0a6d24ec2 Add a "validate" target
Add a "validate" target to the top level Makefile that checks formatting
of source files with golint, signed-off-by tags with git-validate, and
for various other warnings with gometalinter.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #62
Approved by: rhatdan
2017-04-12 21:25:35 +00:00

8 lines
318 B
Bash
Executable File

#!/bin/bash
if test $(find -name "*.go" -not -path "./vendor/*" -print0 | xargs -n 1 -0 gofmt -s -l | wc -l) -ne 0 ; then
echo Error: source files are not formatted according to recommendations. Run \"gofmt -s -w\" on:
find -name "*.go" -not -path "./vendor/*" -print0 | xargs -n 1 -0 gofmt -s -l
exit 1
fi
exit 0