-
Notifications
You must be signed in to change notification settings - Fork 16
/
vet.sh
executable file
·48 lines (37 loc) · 838 Bytes
/
vet.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
[[ "$TRACE" ]] && set -x
pushd `dirname "$0"` > /dev/null
trap __EXIT EXIT
colorful=false
tput setaf 7 > /dev/null 2>&1
if [[ $? -eq 0 ]]; then
colorful=true
fi
function __EXIT() {
popd > /dev/null
}
function printError() {
$colorful && tput setaf 1
>&2 echo "Error: $@"
$colorful && tput setaf 7
}
function printImportantMessage() {
$colorful && tput setaf 3
>&2 echo "$@"
$colorful && tput setaf 7
}
function printUsage() {
$colorful && tput setaf 3
>&2 echo "$@"
$colorful && tput setaf 7
}
printImportantMessage "====== gofmt"
gofmt -w .
printImportantMessage "====== go vet"
go vet ./...
printImportantMessage "====== gocyclo"
gocyclo -over 15 .
printImportantMessage "====== ineffassign"
ineffassign ./...
printImportantMessage "====== misspell"
misspell *