| 1 |
PROJECT := github.com/juju/errors |
| 2 |
|
| 3 |
.PHONY: check-licence check-go check docs |
| 4 |
|
| 5 |
check: check-licence check-go |
| 6 |
go test $(PROJECT)/... |
| 7 |
|
| 8 |
check-licence: |
| 9 |
@(fgrep -rl "Licensed under the LGPLv3" --exclude *.s .;\ |
| 10 |
fgrep -rl "MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT" --exclude *.s .;\ |
| 11 |
find . -name "*.go") | sed -e 's,\./,,' | sort | uniq -u | \ |
| 12 |
xargs -I {} echo FAIL: licence missed: {} |
| 13 |
|
| 14 |
check-go: |
| 15 |
$(eval GOFMT := $(strip $(shell gofmt -l .| sed -e "s/^/ /g"))) |
| 16 |
@(if [ x$(GOFMT) != x"" ]; then \ |
| 17 |
echo go fmt is sad: $(GOFMT); \ |
| 18 |
exit 1; \ |
| 19 |
fi ) |
| 20 |
@(go vet -all -composites=false -copylocks=false .) |
| 21 |
|
| 22 |
docs: |
| 23 |
godoc2md github.com/juju/errors > README.md |
| 24 |
sed -i '5i[\[GoDoc](https://godoc.org/github.com/juju/errors?status.svg)](https://godoc.org/github.com/juju/errors)' README.md |