From 3c19e0820b021f12f1a7fa9dcc54d3d2cb7ce28b Mon Sep 17 00:00:00 2001 From: James Hillyerd Date: Tue, 27 Feb 2018 20:41:45 -0800 Subject: [PATCH] Add Makefile for developer convenience. --- .travis.yml | 6 ++---- Makefile | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 Makefile diff --git a/.travis.yml b/.travis.yml index 59d36e9..b9ea160 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,13 +5,11 @@ env: - DEPLOY_WITH_MAJOR="1.9" before_script: - - go vet ./... + - go get github.com/golang/lint/golint go: - - 1.8.x - 1.9.x - -script: go test -race -v ./... + - "1.10" deploy: provider: script diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8101866 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +PKG := inbucket +SHELL := /bin/sh + +SRC := $(shell find . -type f -name '*.go' -not -path "./vendor/*") +PKGS := $$(go list ./... | grep -v /vendor/) + +.PHONY: all build clean fmt install lint simplify test + +all: test lint build + +clean: + go clean + +deps: + go get -t ./... + +build: clean deps + go build + +install: build + go install + +test: clean deps + go test -race ./... + +fmt: + @gofmt -l -w $(SRC) + +simplify: + @gofmt -s -l -w $(SRC) + +lint: + @test -z "$(shell gofmt -l . | tee /dev/stderr)" || echo "[WARN] Fix formatting issues with 'make fmt'" + @golint -set_exit_status $${PKGS} + @go vet $${PKGS}