File: golangci-lint.sh

package info (click to toggle)
podman 5.7.0%2Bds2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,824 kB
  • sloc: sh: 4,700; python: 2,798; perl: 1,885; ansic: 1,484; makefile: 977; ruby: 42; csh: 8
file content (36 lines) | stat: -rwxr-xr-x 1,019 bytes parent folder | download
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
#!/usr/bin/env bash

# Run golangci-lint with different sets of build tags.
set -e

# WARNING: This script executes on multiple operating systems that
# do not have the same version of Bash.  Specifically, Darwin uses
# a very old version, where modern features (like `declare -A`) are
# absent.

declare -a EXTRA_TAGS

echo "Linting for GOOS=$GOOS"
case "$GOOS" in
  windows|darwin)
    # For Darwin and Windows, only "remote" linting is possible and required.
    TAGS="remote,containers_image_openpgp"
    ;;
  freebsd)
    TAGS="containers_image_openpgp"
    EXTRA_TAGS=(",remote")
    ;;
  *)
    # Assume Linux: run linter for various sets of build tags.
    TAGS="apparmor,seccomp,selinux"
    EXTRA_TAGS=(",systemd" ",remote")
esac

for EXTRA in "" "${EXTRA_TAGS[@]}"; do
  # Use set -x in a subshell to make it easy for a developer to copy-paste
  # the command-line to focus or debug a single, specific linting category.
  (
    set -x
    ./bin/golangci-lint run --build-tags="${TAGS}${EXTRA}" "$@"
  )
done