Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
Add staticcheck to .travis.yml
Browse files Browse the repository at this point in the history
Add the $PKGS var, to avoid having to type $(go list ./... | grep -v
/vendor/) over and over.
Add leading and trailing slashes to vendor (vendor -> /vendor/) so that
a go files containing "vendor" won't be filtered.
Remove unnecessary indentation.
Add the before_script section, so $PKGS can be calculated and
staticcheck can be fetched without polluting the logs.
Add the $STATICCHECK_IGNORE var, which tells staticcheck to ignore the
deprecation warning for filepath.HasPrefix in two files.
  • Loading branch information
Ryan Boehning committed Apr 16, 2017
1 parent 5f91615 commit e2b3e73
Showing 1 changed file with 30 additions and 24 deletions.
54 changes: 30 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
---
language: go
sudo: false
notifications:
email: false
matrix:
include:
- os: linux
go: 1.7.x
- os: linux
go: 1.8.x
- os: linux
go: tip
- os: osx
go: 1.8.x
install:
- echo "This is an override of the default install deps step in travis."
script:
- go build -v ./cmd/dep
- go vet $(go list ./... | grep -v vendor)
- test -z "$(gofmt -s -l . 2>&1 | grep -v vendor | tee /dev/stderr)"
- go test -race $(go list ./... | grep -v vendor)
- go build ./hack/licenseok
- find . -path ./vendor -prune -o -type f -name "*.go" -printf '%P\n' | xargs ./licenseok
- ./hack/validate-vendor.bash
language: go
sudo: false
notifications:
email: false
matrix:
include:
- os: linux
go: 1.7.x
- os: linux
go: 1.8.x
- os: linux
go: tip
- os: osx
go: 1.8.x
install:
- echo "This is an override of the default install deps step in travis."
before_script:
- PKGS=$(go list ./... | grep -v /vendor/)
- go get -v honnef.co/go/tools/cmd/staticcheck
script:
- go build -v ./cmd/dep
- go vet $PKGS
# Ignore the deprecation warning about filepath.HasPrefix (SA1019). This flag
# can be removed when issue #296 is resolved.
- staticcheck -ignore='github.com/golang/dep/context.go:SA1019 github.com/golang/dep/cmd/dep/init.go:SA1019' $PKGS
- test -z "$(gofmt -s -l . 2>&1 | grep -v vendor/ | tee /dev/stderr)"
- go test -race $PKGS
- go build ./hack/licenseok
- find . -path ./vendor -prune -o -type f -name "*.go" -printf '%P\n' | xargs ./licenseok
- ./hack/validate-vendor.bash

0 comments on commit e2b3e73

Please sign in to comment.