-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #243 from kuzzleio/1-dev
RELEASE 2.0.0
- Loading branch information
Showing
359 changed files
with
2,662 additions
and
18,336 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
cover_dir=".cover" | ||
profile="$cover_dir/cover.out" | ||
mode=count | ||
timeout=${TIMEOUT:=1m} | ||
|
||
generate_cover_data() { | ||
rm -rf "$cover_dir" | ||
mkdir "$cover_dir" | ||
go test -timeout "$timeout" -covermode="$mode" -coverprofile="$profile" ./... | ||
} | ||
|
||
show_cover_report() { | ||
go tool cover -${1}="$profile" | ||
} | ||
|
||
linter_check() { | ||
invalid_files=$(gofmt -l "$1") | ||
|
||
if [ -n "${invalid_files}" ]; then | ||
echo "Lint errors on the following files:" | ||
echo ${invalid_files} | ||
exit 1 | ||
fi | ||
} | ||
|
||
linter_check . | ||
generate_cover_data | ||
show_cover_report func | ||
|
||
case "$1" in | ||
"") | ||
;; | ||
--html) | ||
show_cover_report html ;; | ||
*) | ||
echo >&2 "error: invalid option: $1"; exit 1 ;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.cover | ||
.compiled_test | ||
.idea | ||
.vscode | ||
main.go | ||
|
Oops, something went wrong.