summaryrefslogtreecommitdiff
path: root/.tool/lint
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2019-04-05 19:49:36 -0500
committerbaude <bbaude@redhat.com>2019-04-05 20:09:45 -0500
commit23602de816b9ee3e92a8cbac295e955ba43fa283 (patch)
tree8ae6789a7e7e5e52de2270bb3854f01dc55b9949 /.tool/lint
parentbc320be00bc584bd88525266d23a9d5edb9d44f8 (diff)
downloadpodman-23602de816b9ee3e92a8cbac295e955ba43fa283.tar.gz
podman-23602de816b9ee3e92a8cbac295e955ba43fa283.tar.bz2
podman-23602de816b9ee3e92a8cbac295e955ba43fa283.zip
Revert "Switch to golangci-lint"
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to '.tool/lint')
-rwxr-xr-x.tool/lint48
1 files changed, 48 insertions, 0 deletions
diff --git a/.tool/lint b/.tool/lint
new file mode 100755
index 000000000..f7bf81c1d
--- /dev/null
+++ b/.tool/lint
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+
+set -o errexit
+set -o nounset
+set -o pipefail
+
+# Create the linter path for use later
+LINTER=${GOPATH}/bin/gometalinter
+
+# Make sure gometalinter is installed
+if [ ! -f ${LINTER} ]; then
+ echo >&2 "gometalinter must be installed. Please run 'make install.tools' and try again"
+ exit 1
+fi
+
+PKGS=$(find . -type d -not -path . -a -not -iwholename '*.git*' -a -not -iname '.tool' -a -not -iwholename '*vendor*' -a -not -iname 'hack' -a -not -iwholename '*.artifacts*' -a -not -iwholename '*contrib*' -a -not -iwholename '*test*' -a -not -iwholename '*logo*' -a -not -iwholename '*conmon*' -a -not -iwholename '*completions*' -a -not -iwholename '*docs*' -a -not -iwholename '*pause*' -a -not -iwholename './_output*' -a -not -iwholename '*ioprojectatomicpodman.go')
+
+echo $PKGS
+
+# Execute the linter
+${LINTER} \
+ --concurrency=4\
+ --enable-gc\
+ --vendored-linters\
+ --deadline=600s --disable-all\
+ --enable=deadcode\
+ --enable=errcheck\
+ --enable=goconst\
+ --enable=gofmt\
+ --enable=golint\
+ --enable=ineffassign\
+ --enable=megacheck\
+ --enable=misspell\
+ --enable=structcheck\
+ --enable=varcheck\
+ --enable=vet\
+ --enable=vetshadow\
+ --exclude='error return value not checked.*\(errcheck\)$'\
+ --exclude='declaration of.*err.*shadows declaration.*\(vetshadow\)$'\
+ --exclude='.*_test\.go:.*error return value not checked.*\(errcheck\)$'\
+ --exclude='duplicate of.*_test.go.*\(dupl\)$'\
+ --exclude='cmd\/client\/.*\.go.*\(dupl\)$'\
+ --exclude='libpod\/.*_easyjson.go:.*'\
+ --exclude='.* other occurrence\(s\) of "(container|host|tmpfs|unknown)" found in: .*\(goconst\)$'\
+ --exclude='vendor\/.*'\
+ --exclude='podman\/.*'\
+ --exclude='server\/seccomp\/.*\.go.*$'\
+ ${PKGS[@]}