commit
a186d5f87a
5 changed files with 39 additions and 5 deletions
2
Makefile
2
Makefile
|
@ -45,7 +45,7 @@ test-integration: build ## run the integration tests
|
|||
$(DOCKER_RUN_TRAEFIK) ./script/make.sh generate test-integration
|
||||
|
||||
validate: build ## validate gofmt, golint and go vet
|
||||
$(DOCKER_RUN_TRAEFIK) ./script/make.sh validate-gofmt validate-govet validate-golint
|
||||
$(DOCKER_RUN_TRAEFIK) ./script/make.sh validate-gofmt validate-govet validate-golint validate-misspell
|
||||
|
||||
build: dist
|
||||
docker build $(DOCKER_BUILD_ARGS) -t "$(TRAEFIK_DEV_IMAGE)" -f build.Dockerfile .
|
||||
|
|
|
@ -3,7 +3,8 @@ FROM golang:1.7
|
|||
RUN go get github.com/Masterminds/glide \
|
||||
&& go get github.com/jteeuwen/go-bindata/... \
|
||||
&& go get github.com/golang/lint/golint \
|
||||
&& go get github.com/kisielk/errcheck
|
||||
&& go get github.com/kisielk/errcheck \
|
||||
&& go get github.com/client9/misspell/cmd/misspell
|
||||
|
||||
# Which docker version to test on
|
||||
ARG DOCKER_VERSION=1.10.1
|
||||
|
|
|
@ -248,6 +248,6 @@ func (s *datastoreTransaction) Commit(object Object) error {
|
|||
}
|
||||
|
||||
s.dirty = true
|
||||
log.Debugf("Transaction commited %s", s.id)
|
||||
log.Debugf("Transaction committed %s", s.id)
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -270,7 +270,7 @@ Here is an example of backends and servers definition:
|
|||
|
||||
Træfɪk's configuration has two parts:
|
||||
|
||||
- The [static Træfɪk configuration](/basics#static-trfk-configuration) which is loaded only at the begining.
|
||||
- The [static Træfɪk configuration](/basics#static-trfk-configuration) which is loaded only at the beginning.
|
||||
- The [dynamic Træfɪk configuration](/basics#dynamic-trfk-configuration) which can be hot-reloaded (no need to restart the process).
|
||||
|
||||
|
||||
|
@ -356,7 +356,7 @@ All those related flags will be displayed with :
|
|||
$ traefik [command] --help
|
||||
```
|
||||
|
||||
Note that each command is described at the begining of the help section:
|
||||
Note that each command is described at the beginning of the help section:
|
||||
|
||||
```bash
|
||||
$ traefik --help
|
||||
|
|
33
script/validate-misspell
Executable file
33
script/validate-misspell
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
|
||||
source "$(dirname "$BASH_SOURCE")/.validate"
|
||||
|
||||
IFS=$'\n'
|
||||
src=( $(validate_diff --diff-filter=ACMR --name-only -- '*.go' | grep -v '^vendor/\|autogen' || true) )
|
||||
docs=( $(validate_diff --diff-filter=ACMR --name-only -- 'docs/*.md') )
|
||||
unset IFS
|
||||
files=("${src[@]}" "${docs[@]}")
|
||||
|
||||
errors=()
|
||||
for f in "${files[@]}"; do
|
||||
# we use source text here so we also check spelling of variable names
|
||||
failedSpell=$(misspell -source=text "$f")
|
||||
if [ "$failedSpell" ]; then
|
||||
errors+=( "$failedSpell" )
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${#errors[@]} -eq 0 ]; then
|
||||
echo 'Congratulations! All Go source files and docs have been checked for common mispellings.'
|
||||
else
|
||||
{
|
||||
echo "Errors from misspell:"
|
||||
for err in "${errors[@]}"; do
|
||||
echo "$err"
|
||||
done
|
||||
echo
|
||||
echo 'Please fix the above errors. You can test via "misspell" and commit the result.'
|
||||
echo
|
||||
} >&2
|
||||
false
|
||||
fi
|
Loading…
Reference in a new issue