From 35e834a02e8339b96758ebb66ee1f8f376f1586c Mon Sep 17 00:00:00 2001 From: Rohith Jayawardene <gambol99@gmail.com> Date: Fri, 2 Mar 2018 21:48:52 +0000 Subject: [PATCH] Spelling Check (#322) - adding the misspell check to `make test` --- .travis.yml | 1 + Makefile | 8 ++++++++ doc.go | 2 +- rotation.go | 2 +- server.go | 2 +- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1d507a0..e1edf4f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ go: install: - go get github.com/Masterminds/glide - go get github.com/mattn/goveralls +- go get -u github.com/client9/misspell/cmd/misspell script: - make test - if ([[ ${TRAVIS_BRANCH} == "master" ]] && [[ ${TRAVIS_EVENT_TYPE} == "push" ]]) || [[ -n ${TRAVIS_TAG} ]]; then diff --git a/Makefile b/Makefile index 5fe92f7..86d4a7f 100644 --- a/Makefile +++ b/Makefile @@ -133,6 +133,13 @@ cover: @echo "--> Running go cover" @go test --cover +spelling: + @echo "--> Chekcing the spelling" + @which misspell 2>/dev/null ; if [ $$? -eq 1 ]; then \ + go get -u github.com/client9/misspell/cmd/misspell; \ + fi + @misspell -error *.go + test: @echo "--> Running the tests" @if [ ! -d "vendor" ]; then \ @@ -141,6 +148,7 @@ test: @go test -v @$(MAKE) golang @$(MAKE) gofmt + @$(MAKE) spelling @$(MAKE) vet @$(MAKE) cover diff --git a/doc.go b/doc.go index f14abaa..c89fab5 100644 --- a/doc.go +++ b/doc.go @@ -140,7 +140,7 @@ type Config struct { Headers map[string]string `json:"headers" yaml:"headers" usage:"custom headers to the upstream request, key=value"` // EnableDefaultDeny indicates we should deny by default all requests - EnableDefaultDeny bool `json:"enable-default-deny" yaml:"enable-default-deny" usage:"enables a default denial on all requests, you have to explicity say what is permitted (recommended)"` + EnableDefaultDeny bool `json:"enable-default-deny" yaml:"enable-default-deny" usage:"enables a default denial on all requests, you have to explicitly say what is permitted (recommended)"` // EnableEncryptedToken indicates the access token should be encoded EnableEncryptedToken bool `json:"enable-encrypted-token" yaml:"enable-encrypted-token" usage:"enable encryption for the access tokens"` // EnableLogging indicates if we should log all the requests diff --git a/rotation.go b/rotation.go index 3d8479e..509b4ca 100644 --- a/rotation.go +++ b/rotation.go @@ -95,7 +95,7 @@ func (c *certificationRotation) watch() error { c.log.Info("replacing the server certifacte with updated version") } case err := <-watcher.Errors: - c.log.Error("recieved an error from the file watcher", zap.Error(err)) + c.log.Error("received an error from the file watcher", zap.Error(err)) } } }() diff --git a/server.go b/server.go index 00f042c..1ef3dca 100644 --- a/server.go +++ b/server.go @@ -217,7 +217,7 @@ func (r *oauthProxy) createReverseProxy() error { r.log.Warn("the resource url is not a prefix", zap.String("resource", x.URL), zap.String("change", x.URL), - zap.String("ammended", strings.TrimRight(x.URL, "/"))) + zap.String("amended", strings.TrimRight(x.URL, "/"))) } if x.URL == "/*" && r.config.EnableDefaultDeny { switch x.WhiteListed { -- GitLab