-
Notifications
You must be signed in to change notification settings - Fork 0
/
lint.sh
executable file
·32 lines (29 loc) · 965 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
#!/bin/sh
ZEROLINT="$(which zerolint)"
if [ -z "$ZEROLINT" ]; then
go install fillmore-labs.com/zerolint@latest
ZEROLINT="$(go env GOPATH)/bin/zerolint"
fi
[ -x "$ZEROLINT" ] || exit 1
EXCLUDES="$(pwd)/excludes"
for i in temp/*/*; do
if [ ! -d $i ]; then
echo "run ./prepare.sh first"
exit 1
fi
if [ ! -r "$EXCLUDES/$i.txt" ]; then
echo "# zerolint exclusions for $i" > "$EXCLUDES/$i.txt"
fi
echo "Running zerolint on $i..."
find $i -type d \(\
-name _asm -o \
-path temp/99designs/gqlgen/_examples -o \
-path temp/etcd-io/etcd/tools/mod -o \
-path temp/gohugoio/hugo/docs -o \
-path temp/golingon/lingon/docs -o \
-path temp/kubernetes/kubernetes/hack/tools -o \
-path temp/prometheus/prometheus/documentation/examples/remote_storage -o \
-path temp/tailscale/tailscale/gokrazy/\*/builddir \
\) -prune -o \
-name go.mod -execdir "$ZEROLINT" -excluded "$EXCLUDES/$i.txt" -zerotrace ./... \;
done