Skip to content
Snippets Groups Projects
Unverified Commit 35e834a0 authored by Rohith Jayawardene's avatar Rohith Jayawardene Committed by GitHub
Browse files

Spelling Check (#322)

- adding the misspell check to `make test`
parent 4d69ac34
Branches
No related tags found
No related merge requests found
...@@ -14,6 +14,7 @@ go: ...@@ -14,6 +14,7 @@ go:
install: install:
- go get github.com/Masterminds/glide - go get github.com/Masterminds/glide
- go get github.com/mattn/goveralls - go get github.com/mattn/goveralls
- go get -u github.com/client9/misspell/cmd/misspell
script: script:
- make test - make test
- if ([[ ${TRAVIS_BRANCH} == "master" ]] && [[ ${TRAVIS_EVENT_TYPE} == "push" ]]) || [[ -n ${TRAVIS_TAG} ]]; then - if ([[ ${TRAVIS_BRANCH} == "master" ]] && [[ ${TRAVIS_EVENT_TYPE} == "push" ]]) || [[ -n ${TRAVIS_TAG} ]]; then
......
...@@ -133,6 +133,13 @@ cover: ...@@ -133,6 +133,13 @@ cover:
@echo "--> Running go cover" @echo "--> Running go cover"
@go test --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: test:
@echo "--> Running the tests" @echo "--> Running the tests"
@if [ ! -d "vendor" ]; then \ @if [ ! -d "vendor" ]; then \
...@@ -141,6 +148,7 @@ test: ...@@ -141,6 +148,7 @@ test:
@go test -v @go test -v
@$(MAKE) golang @$(MAKE) golang
@$(MAKE) gofmt @$(MAKE) gofmt
@$(MAKE) spelling
@$(MAKE) vet @$(MAKE) vet
@$(MAKE) cover @$(MAKE) cover
......
...@@ -140,7 +140,7 @@ type Config struct { ...@@ -140,7 +140,7 @@ type Config struct {
Headers map[string]string `json:"headers" yaml:"headers" usage:"custom headers to the upstream request, key=value"` 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 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 indicates the access token should be encoded
EnableEncryptedToken bool `json:"enable-encrypted-token" yaml:"enable-encrypted-token" usage:"enable encryption for the access tokens"` 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 // EnableLogging indicates if we should log all the requests
......
...@@ -95,7 +95,7 @@ func (c *certificationRotation) watch() error { ...@@ -95,7 +95,7 @@ func (c *certificationRotation) watch() error {
c.log.Info("replacing the server certifacte with updated version") c.log.Info("replacing the server certifacte with updated version")
} }
case err := <-watcher.Errors: 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))
} }
} }
}() }()
......
...@@ -217,7 +217,7 @@ func (r *oauthProxy) createReverseProxy() error { ...@@ -217,7 +217,7 @@ func (r *oauthProxy) createReverseProxy() error {
r.log.Warn("the resource url is not a prefix", r.log.Warn("the resource url is not a prefix",
zap.String("resource", x.URL), zap.String("resource", x.URL),
zap.String("change", 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 { if x.URL == "/*" && r.config.EnableDefaultDeny {
switch x.WhiteListed { switch x.WhiteListed {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment