-
Notifications
You must be signed in to change notification settings - Fork 1
/
linter.sh
executable file
·62 lines (54 loc) · 998 Bytes
/
linter.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# make continue when error
set +e
# make break when error
# set -e
GometalinterVariable=(
"deadcode"
"dupl"
"errcheck"
"gochecknoglobals"
"gochecknoinits"
"goconst"
"gocyclo"
"gofmt"
"goimports"
"golint"
"gosec"
"gosimple"
"gotype"
"gotypex"
"ineffassign"
"interfacer"
"lll"
"maligned"
"megacheck"
"nakedret"
"safesql"
"staticcheck"
"structcheck"
"test"
"testify"
"unconvert"
"unparam"
"unused"
"varcheck"
"vet"
"vetshadow"
)
Directory=(
"migrations/seed"
"migrations/version"
)
arrayGometalinterVariable=${#GometalinterVariable[@]}
arrayDirectory=${#Directory[@]}
for ((k=0; k<${arrayDirectory}; k++));
do
for ((i=0; i<${arrayGometalinterVariable}; i++));
do
echo "Currently linter running in ${Directory[$k]} ==> ${GometalinterVariable[$i]}"
gometalinter -j 1 --disable-all --enable=${GometalinterVariable[$i]} ${Directory[$k]}/ 2>&1
sleep 1
wait
done
done