From 9d0253398ce290747d1874252da1fca987c618a5 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Sat, 20 Jun 2015 12:20:35 -0400 Subject: [PATCH] add makefile and linting helper script --- Makefile | 9 +++++++++ lint.sh | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 Makefile create mode 100755 lint.sh diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d5e850e --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +test: lint go-test + +lint: + ./lint.sh + +go-test: + go test + +.PHONY: lint test diff --git a/lint.sh b/lint.sh new file mode 100755 index 0000000..9cf850b --- /dev/null +++ b/lint.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -e + +# Test to make sure we didn't get any linting errors +# while also writing the linting errors to stderr +# DEV: `test -z` ensures the value is empty +# DEV: `| tee >(cat >&2)` takes the stdout from `golint` and replays it on stderr +# this way we see the linting errors while still capturing them for `test -z` +test -z "`golint | tee >(cat >&2)`"