Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit 50bcf4c

Browse files
committed
CI: enforce that dep prune is run
1 parent d1f8b38 commit 50bcf4c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+4
-15598
lines changed

hack/validate-vendor.bash

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,18 @@ files=( $(validate_diff --diff-filter=ACMR --name-only -- 'Gopkg.toml' 'Gopkg.lo
3131
unset IFS
3232

3333
if [ ${#files[@]} -gt 0 ]; then
34-
# This will delete memo section from Gopkg.lock
35-
# See https://github.com/golang/dep/issues/645 for more info
36-
# This should go away after -vendor-only flag will be implemented
37-
# sed -i not used because it works different on MacOS and Linux
38-
TMP_FILE=`mktemp /tmp/Gopkg.lock.XXXXXXXXXX`
39-
sed '/memo = \S*/d' Gopkg.lock > $TMP_FILE
40-
mv $TMP_FILE Gopkg.lock
41-
42-
# We run ensure to and see if we have a diff afterwards
4334
go build ./cmd/dep
44-
./dep ensure
35+
./dep ensure -vendor-only
36+
./dep prune
4537
# Let see if the working directory is clean
4638
diffs="$(git status --porcelain -- vendor Gopkg.toml Gopkg.lock 2>/dev/null)"
4739
if [ "$diffs" ]; then
4840
{
49-
echo 'The result of ensure differs'
41+
echo 'The contents of vendor differ after "dep ensure && dep prune":'
5042
echo
5143
echo "$diffs"
5244
echo
53-
echo 'Please vendor your package with github.com/golang/dep.'
45+
echo 'Make sure these commands have been run before committing.'
5446
echo
5547
} >&2
5648
false

0 commit comments

Comments
 (0)