Added script to confirm API docs up-to-date.
This commit is contained in:
@@ -32,9 +32,10 @@ before_script:
|
|||||||
- PKGS=$(go list ./... | grep -v /vendor/) # All the import paths, excluding vendor/
|
- PKGS=$(go list ./... | grep -v /vendor/) # All the import paths, excluding vendor/
|
||||||
# - go get github.com/golang/lint/golint # Linter
|
# - go get github.com/golang/lint/golint # Linter
|
||||||
#- go get honnef.co/go/tools/cmd/megacheck # Badass static analyzer/linter
|
#- go get honnef.co/go/tools/cmd/megacheck # Badass static analyzer/linter
|
||||||
|
- go get -u github.com/swaggo/swag/cmd/swag # CLI tool for auto-generating swagger docs
|
||||||
|
- ci/check_swagger_sync.sh # Script to check that Swagger docs are up-to-date
|
||||||
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.12.2
|
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.12.2
|
||||||
|
|
||||||
|
|
||||||
# Anything in before_script: that returns a nonzero exit code will
|
# Anything in before_script: that returns a nonzero exit code will
|
||||||
# flunk the build and immediately stop. It's sorta like having
|
# flunk the build and immediately stop. It's sorta like having
|
||||||
# set -e enabled in bash.
|
# set -e enabled in bash.
|
||||||
|
|||||||
10
ci/check_swagger_sync.sh
Executable file
10
ci/check_swagger_sync.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
$GOPATH/bin/swag init --generalInfo bridge/api/api.go --dir . 2> /dev/null
|
||||||
|
|
||||||
|
# When regenerated, only a single date line changes.
|
||||||
|
# A minimal one-line diff shows as two operations (addition + subtraction),
|
||||||
|
# with 7 lines in the diff output
|
||||||
|
if [ "$(git diff --unified=0 | wc -l)" -gt 7 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user