-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from liggitt/godoc-gofmt
Update godoc, add gofmt check
- Loading branch information
Showing
16 changed files
with
301 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
# install from the root of the repo with: | ||
# ln -s ../../.githooks/pre-push .git/hooks/pre-push | ||
|
||
make vet fmt lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
language: go | ||
env: | ||
global: | ||
- VET_VERSIONS="1.5 1.6 tip" | ||
- LINT_VERSIONS="1.5 1.6 tip" | ||
go: | ||
- 1.2 | ||
- 1.3 | ||
- 1.4 | ||
- 1.5 | ||
- 1.6 | ||
- tip | ||
go_import_path: gopkg.in/ldap.v2 | ||
install: | ||
- go get gopkg.in/asn1-ber.v1 | ||
- go get gopkg.in/ldap.v2 | ||
- go get code.google.com/p/go.tools/cmd/cover || go get golang.org/x/tools/cmd/cover | ||
- go get github.com/golang/lint/golint || true | ||
- go build -v ./... | ||
script: | ||
- go test -v -cover ./... | ||
- make test | ||
- make fmt | ||
- if [[ "$VET_VERSIONS" == *"$TRAVIS_GO_VERSION"* ]]; then make vet; fi | ||
- if [[ "$LINT_VERSIONS" == *"$TRAVIS_GO_VERSION"* ]]; then make lint; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.PHONY: default install build test quicktest fmt vet lint | ||
|
||
default: fmt vet lint build quicktest | ||
|
||
install: | ||
go get -t -v ./... | ||
|
||
build: | ||
go build -v ./... | ||
|
||
test: | ||
go test -v -cover ./... | ||
|
||
quicktest: | ||
go test ./... | ||
|
||
# Capture output and force failure when there is non-empty output | ||
fmt: | ||
@echo gofmt -l . | ||
@OUTPUT=`gofmt -l . 2>&1`; \ | ||
if [ "$$OUTPUT" ]; then \ | ||
echo "gofmt must be run on the following files:"; \ | ||
echo "$$OUTPUT"; \ | ||
exit 1; \ | ||
fi | ||
|
||
# Only run on go1.5+ | ||
vet: | ||
go tool vet -atomic -bool -copylocks -nilfunc -printf -shadow -rangeloops -unreachable -unsafeptr -unusedresult . | ||
|
||
# https://github.com/golang/lint | ||
# go get github.com/golang/lint/golint | ||
# Capture output and force failure when there is non-empty output | ||
# Only run on go1.5+ | ||
lint: | ||
@echo golint ./... | ||
@OUTPUT=`golint ./... 2>&1`; \ | ||
if [ "$$OUTPUT" ]; then \ | ||
echo "golint errors:"; \ | ||
echo "$$OUTPUT"; \ | ||
exit 1; \ | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.