Skip to content

Commit c57be8a

Browse files
committed
Cleanup ztest.sh
1 parent 8654c77 commit c57be8a

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

ztest.sh

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,26 @@ FAIL="\x1b[31mFAIL"
1212
RESET="\x1b[0m"
1313

1414
echo -e "${BOLD}fmt${RESET}"
15-
go fmt ./...
16-
echo
17-
18-
echo -e "${BOLD}build${RESET}"
19-
go install -v ./...
20-
RET_BUILD=$?
21-
echo
15+
RET_FMT=$(find . -name "*.go" | egrep -v "/(_.*_|\..*|testdata)/" | xargs gofmt -d)
16+
if [[ ! -z "$RET_FMT" ]]; then echo "$RET_FMT"; echo; fi
2217

2318
echo -e "${BOLD}test${RESET}"
2419
RET_TEST=$(go test -race ./... | egrep -v "^(ok|[?])\s+")
25-
if [[ ! -z "$RET_TEST" ]]; then echo "$RET_TEST"; fi
26-
echo
20+
if [[ ! -z "$RET_TEST" ]]; then echo "$RET_TEST"; echo; fi
2721

2822
echo -e "${BOLD}staticcheck${RESET}"
2923
RET_SCHK=$(staticcheck \
3024
-ignore "
3125
github.com/dsnet/compress/internal/prefix/*.go:SA4016
3226
github.com/dsnet/compress/brotli/*.go:SA4016
3327
" ./... 2>&1)
34-
if [[ ! -z "$RET_SCHK" ]]; then echo "$RET_SCHK"; fi
35-
echo
28+
if [[ ! -z "$RET_SCHK" ]]; then echo "$RET_SCHK"; echo; fi
3629

3730
echo -e "${BOLD}vet${RESET}"
3831
RET_VET=$(go vet ./... 2>&1 |
3932
egrep -v "^flate/dict_decoder.go:(.*)WriteByte" |
4033
egrep -v "^exit status")
41-
if [[ ! -z "$RET_VET" ]]; then echo "$RET_VET"; fi
42-
echo
34+
if [[ ! -z "$RET_VET" ]]; then echo "$RET_VET"; echo; fi
4335

4436
echo -e "${BOLD}lint${RESET}"
4537
RET_LINT=$(golint ./... 2>&1 |
@@ -49,10 +41,9 @@ RET_LINT=$(golint ./... 2>&1 |
4941
egrep -v "^internal/prefix/prefix.go:(.*)replace symBits(.*) [-]= 1 with symBits(.*)[-]{2}" |
5042
egrep -v "^xflate/common.go:(.*)NoCompression should be of the form" |
5143
egrep -v "^exit status")
52-
if [[ ! -z "$RET_LINT" ]]; then echo "$RET_LINT"; fi
53-
echo
44+
if [[ ! -z "$RET_LINT" ]]; then echo "$RET_LINT"; echo; fi
5445

55-
if [ $RET_BUILD -ne 0 ] || [ ! -z "$RET_TEST" ] || [[ ! -z "$RET_VET" ]] || [[ ! -z "$RET_SCHK" ]] || [[ ! -z "$RET_LINT" ]]; then
46+
if [[ ! -z "$RET_FMT" ]] || [ ! -z "$RET_TEST" ] || [[ ! -z "$RET_VET" ]] || [[ ! -z "$RET_SCHK" ]] || [[ ! -z "$RET_LINT" ]] || [[ ! -z "$RET_SPELL" ]]; then
5647
echo -e "${FAIL}${RESET}"; exit 1
5748
else
5849
echo -e "${PASS}${RESET}"; exit 0

0 commit comments

Comments
 (0)