Skip to content

Commit

Permalink
test/lint/godeps: don't abort on first error
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel committed Aug 30, 2024
1 parent 78cd92f commit 282f82a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/lint/godeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ set -o pipefail
# Ensure predictable sorting
export LC_ALL=C.UTF-8

rc=0
for pkg in client lxc/config lxd-agent shared/api; do
echo ""
echo "==> Checking for imports/deps that have been added to ${pkg}..."
DEP_FILE="test/godeps/$(echo "${pkg}" | sed 's/\//-/g').list"
OUT="$(go list -f '{{ join .Deps "\n" }}' ./${pkg} | grep -F . | sort -u | diff --new-file -u "${DEP_FILE}" - || true)"
if [ -n "${OUT}" ]; then
echo "ERROR: you added a new dependency to ${pkg}; please make sure this is what you want"
echo "${OUT}"
exit 1
rc=1
fi
done

exit "${rc}"

0 comments on commit 282f82a

Please sign in to comment.