Skip to content

Commit d9ad7cb

Browse files
committed
Run lint for mac builds
There are darwin-specific code paths which were not being linted prior to this commit. Fix this with a new, darwin-specific section of the lint runner script. Signed-off-by: Chris Evich <[email protected]>
1 parent 4fde98f commit d9ad7cb

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

.cirrus.yml

+2
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,8 @@ osx_alt_build_task:
466466
# This host is/was shared with potentially many other CI tasks.
467467
# The previous task may have been canceled or aborted.
468468
prep_script: &mac_cleanup "contrib/cirrus/mac_cleanup.sh"
469+
lint_script:
470+
- make lint
469471
basic_build_script:
470472
- make .install.ginkgo
471473
- make podman-remote

hack/golangci-lint.sh

+22
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,28 @@
33
# Need to run linter twice to cover all the build tags code paths
44
set -e
55

6+
# Dedicated block for Darwin: OS doesn't support the rest of this
7+
# script, only needs to check 'remote', and its golangci-lint needs
8+
# specialized arguments.
9+
if [[ $(uname -s) == "Darwin" ]] || [[ "$GOOS" == "darwin" ]]; then
10+
declare -a DARWIN_SKIP_DIRS
11+
DARWIN_SKIP_DIRS=(
12+
libpod/events
13+
pkg/api
14+
pkg/domain/infra/abi
15+
pkg/machine/qemu
16+
pkg/trust
17+
test
18+
)
19+
echo ""
20+
echo Running golangci-lint for "remote"
21+
echo Build Tags "remote": remote
22+
echo Skipped directories "remote": ${DARWIN_SKIP_DIRS[*]}
23+
./bin/golangci-lint run --build-tags="remote" \
24+
--skip-dirs=$(tr ' ' ',' <<<"${DARWIN_SKIP_DIRS[@]}")
25+
exit 0 # All done, don't execute anything below, it will break on Darwin
26+
fi
27+
628
declare -A BUILD_TAGS
729
BUILD_TAGS[default]="apparmor,seccomp,selinux"
830
BUILD_TAGS[abi]="${BUILD_TAGS[default]},systemd"

0 commit comments

Comments
 (0)