-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci_linter
More file actions
executable file
·33 lines (26 loc) · 827 Bytes
/
ci_linter
File metadata and controls
executable file
·33 lines (26 loc) · 827 Bytes
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
#!/usr/bin/env bash
go version || exit 1
export GOROOT=$(echo ${GOROOT})
export GOPATH=$(echo ${GOPATH})
[[ "${GOPATH}" != "" ]] || export GOPATH=/go
export PACKAGE_BIN=/usr/src/tools
export PATH=${PACKAGE_BIN}:${GOPATH}/bin:${PATH}
export CC=${CC}
export CGO_ENABLED=${CGO_ENABLED}
export GO111MODULE=${GO111MODULE}
PARAMS=""
if [[ "$@" != "" ]];
then
for VAL in $@
do
PARAMS+=" --skip-dirs=\"${VAL}\""
done
fi
if [[ -e ".golangci.yml" ]];
then
set -x
golangci-lint run
else
set -x
golangci-lint run --no-config ${PARAMS} --skip-dirs="vendors" --color="always" --print-issued-lines --print-linter-name --issues-exit-code=0 --deadline=30m --enable-all --disable=gochecknoinits --disable=gochecknoglobals --disable=wsl --disable=golint --disable=gocritic --disable=stylecheck --disable=whitespace
fi