forked from edwingeng/wuid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lint.sh
executable file
·44 lines (34 loc) · 826 Bytes
/
lint.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
#!/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
}
dirs='bench callback internal mongo mysql redis'
for d in $dirs; do
go vet "github.com/edwingeng/wuid/$d"
done
errcheck github.com/edwingeng/wuid/... \
| ag -v '[ \t]*defer'
golint $dirs | ag -v 'receiver name should be a reflection of its identity'