Skip to content

Commit 6703e8c

Browse files
authored
Merge pull request #210 from asifdxtreme/patch-6
Add gofmt check in travis CI
2 parents 61e9d8e + 9a91282 commit 6703e8c

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ install:
66
- mv $TRAVIS_BUILD_DIR $HOME/gopath/src/k8s.io/kube-state-metrics
77
jobs:
88
include:
9+
- stage: Go fmt
10+
script: make gofmtcheck
911
- stage: Unit Test
1012
script: make test-unit
1113
- stage: Build

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ REGISTRY = gcr.io/google_containers
88
TAG = $(shell git describe --abbrev=0)
99
PKGS = $(shell go list ./... | grep -v /vendor/)
1010

11+
gofmtcheck:
12+
@go fmt $(PKGS) | grep ".*\.go"; if [ "$$?" = "0" ]; then exit 1; fi
13+
1114
deps:
1215
go get github.com/tools/godep
1316

collectors/deployment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import (
2020
"github.com/golang/glog"
2121
"github.com/prometheus/client_golang/prometheus"
2222
"golang.org/x/net/context"
23+
"k8s.io/apimachinery/pkg/util/intstr"
2324
"k8s.io/client-go/kubernetes"
2425
"k8s.io/client-go/pkg/api"
2526
"k8s.io/client-go/pkg/apis/extensions/v1beta1"
26-
"k8s.io/apimachinery/pkg/util/intstr"
2727
"k8s.io/client-go/tools/cache"
2828
)
2929

0 commit comments

Comments
 (0)