summaryrefslogtreecommitdiff
path: root/hack/golangci-lint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'hack/golangci-lint.sh')
-rwxr-xr-xhack/golangci-lint.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/hack/golangci-lint.sh b/hack/golangci-lint.sh
new file mode 100755
index 000000000..385b21f39
--- /dev/null
+++ b/hack/golangci-lint.sh
@@ -0,0 +1,15 @@
+#!/bin/bash -e
+
+# Need to run linter twice to cover all the build tags code paths
+
+declare -A BUILD_TAGS
+BUILD_TAGS[default]="apparmor,seccomp,selinux"
+BUILD_TAGS[abi]="${BUILD_TAGS[default]},ABISupport,varlink,!remoteclient"
+BUILD_TAGS[tunnel]="${BUILD_TAGS[default]},!ABISupport,!varlink,remoteclient"
+
+[[ $1 == run ]] && shift
+
+for i in tunnel abi; do
+ echo Build Tags: ${BUILD_TAGS[$i]}
+ golangci-lint run --build-tags=${BUILD_TAGS[$i]} "$@"
+done