Browse Source

add makefile and linting helper script

pull/16/head
Brett Langdon 11 years ago
parent
commit
9d0253398c
2 changed files with 18 additions and 0 deletions
  1. +9
    -0
      Makefile
  2. +9
    -0
      lint.sh

+ 9
- 0
Makefile View File

@ -0,0 +1,9 @@
test: lint go-test
lint:
./lint.sh
go-test:
go test
.PHONY: lint test

+ 9
- 0
lint.sh View File

@ -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)`"

Loading…
Cancel
Save