aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2018-06-21 12:34:02 +0100
committerGravatar Yong Tang <yong.tang.github@outlook.com> 2018-06-21 04:34:02 -0700
commitad8021230c775f129556fe7f681f0b09a59d480e (patch)
treeb1fc6b90003796e9c3ba186eaa781d35e1581f4f
parent422aec5f5fc9d1f4d4017357f86098ec34eb1676 (diff)
downloadcoredns-ad8021230c775f129556fe7f681f0b09a59d480e.tar.gz
coredns-ad8021230c775f129556fe7f681f0b09a59d480e.tar.zst
coredns-ad8021230c775f129556fe7f681f0b09a59d480e.zip
Makefile fixes: (#1892)
Correctly set the path for the presubmits, fix some typos and make the goimport target do the linting to the lint target can be removed. Also don't make it a fatal error because gofmt changes between releases.
-rw-r--r--.travis.yml1
-rw-r--r--Makefile21
-rw-r--r--core/dnsserver/server_grpc.go4
-rw-r--r--plugin/kubernetes/handler_ignore_emptyservice_test.go3
4 files changed, 12 insertions, 17 deletions
diff --git a/.travis.yml b/.travis.yml
index ec2afbe77..128741c41 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -39,6 +39,5 @@ before_script:
script:
- make TEST_TYPE=$TEST_TYPE travis
-
after_success:
- bash <(curl -s https://codecov.io/bash)
diff --git a/Makefile b/Makefile
index e7b098958..722c58b9e 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ CHECKS:=check godeps
VERBOSE:=-v
GOPATH?=$(HOME)/go
PRESUBMIT:=core coremain plugin test request
+MAKEPWD:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
all: coredns
@@ -14,7 +15,7 @@ coredns: $(CHECKS)
CGO_ENABLED=0 $(SYSTEM) go build $(VERBOSE) -ldflags="-s -w -X github.com/coredns/coredns/coremain.GitCommit=$(GITCOMMIT)" -o $(BINARY)
.PHONY: check
-check: presubmit goimports core/zplugin.go core/dnsserver/zdirectives.go godeps linter
+check: presubmit goimports core/zplugin.go core/dnsserver/zdirectives.go godeps
.PHONY: test
test: check
@@ -26,9 +27,9 @@ testk8s: check
.PHONY: godeps
godeps:
- # Not vendored so external plugin compile, avoiding:
- # cannot use c (type *"github.com/mholt/caddy".Controller) as type
- # *"github.com/coredns/coredns/vendor/github.com/mholt/caddy".Controller like errors.
+ @ # Not vendoring these, so external plugins compile, avoiding:
+ @ # cannot use c (type *"github.com/mholt/caddy".Controller) as type
+ @ # *"github.com/coredns/coredns/vendor/github.com/mholt/caddy".Controller like errors.
(cd $(GOPATH)/src/github.com/mholt/caddy 2>/dev/null && git checkout -q master 2>/dev/null || true)
(cd $(GOPATH)/src/github.com/miekg/dns 2>/dev/null && git checkout -q master 2>/dev/null || true)
(cd $(GOPATH)/src/github.com/prometheus/client_golang 2>/dev/null && git checkout -q master 2>/dev/null || true)
@@ -77,22 +78,16 @@ gen:
pb:
$(MAKE) -C pb
-.PHONY: linter
-linter:
- go get -u github.com/alecthomas/gometalinter
- gometalinter --install golint
- gometalinter --deadline=2m --disable-all --enable=gofmt --enable=golint --enable=vet --vendor --exclude=^pb/ ./...
-
.PHONY: goimports
goimports:
go get -u github.com/alecthomas/gometalinter
- gometalinter --install goimports
- ( gometalinter --deadline=2m --disable-all --enable=goimports --vendor --exclude=^pb/ ./... || true )
+ gometalinter --install goimports > /dev/null
+ ( gometalinter --deadline=2m --disable-all --enable=goimports --enable=golint --enable=vet --vendor --exclude=^pb/ ./... || true )
# Presubmit runs all scripts in .presubmit; any non 0 exit code will fail the build.
.PHONY: presubmit
presubmit:
- @for pre in $(PWD)/.presubmit/* ; do "$$pre" $(PRESUBMIT); done
+ @for pre in $(MAKEPWD)/.presubmit/* ; do "$$pre" $(PRESUBMIT); done
.PHONY: clean
clean:
diff --git a/core/dnsserver/server_grpc.go b/core/dnsserver/server_grpc.go
index 7b3df6474..db81b317f 100644
--- a/core/dnsserver/server_grpc.go
+++ b/core/dnsserver/server_grpc.go
@@ -7,13 +7,13 @@ import (
"fmt"
"net"
+ "github.com/coredns/coredns/pb"
+
"github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc"
"github.com/miekg/dns"
"github.com/opentracing/opentracing-go"
"google.golang.org/grpc"
"google.golang.org/grpc/peer"
-
- "github.com/coredns/coredns/pb"
)
// ServergRPC represents an instance of a DNS-over-gRPC server.
diff --git a/plugin/kubernetes/handler_ignore_emptyservice_test.go b/plugin/kubernetes/handler_ignore_emptyservice_test.go
index 149f8423f..f87dc1d7a 100644
--- a/plugin/kubernetes/handler_ignore_emptyservice_test.go
+++ b/plugin/kubernetes/handler_ignore_emptyservice_test.go
@@ -2,9 +2,10 @@ package kubernetes
import (
"context"
+ "testing"
+
"github.com/coredns/coredns/plugin/pkg/dnstest"
"github.com/coredns/coredns/plugin/test"
- "testing"
"github.com/miekg/dns"
)