Skip to content

Commit 7193749

Browse files
authored
Merge pull request #2102 from dnephin/fix-vendor-validation
[release/1.0] Fix vendor validation
2 parents 04c223f + b9640ad commit 7193749

12 files changed

Lines changed: 284 additions & 106 deletions

File tree

.appveyor.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ before_build:
2323
- choco install codecov
2424

2525
build_script:
26-
- bash.exe -elc "export PATH=/c/tools/mingw64/bin:/c/gopath/bin:$PATH ; mingw32-make.exe setup check"
26+
- bash.exe -elc "export PATH=/c/tools/mingw64/bin:/c/gopath/bin:$PATH;
27+
script/setup/install-dev-tools;
28+
mingw32-make.exe check"
2729
- bash.exe -elc "export PATH=/c/tools/mingw64/bin:$PATH ; mingw32-make.exe build binaries"
2830

2931
test_script:

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ script:
5252
- export GOOS=$TRAVIS_GOOS
5353
- export CGO_ENABLED=$TRAVIS_CGO_ENABLED
5454
- GIT_CHECK_EXCLUDE="./vendor" TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../..}" make dco
55-
- GOOS=linux make setup
55+
- GOOS=linux script/setup/install-dev-tools
56+
- script/validate/vendor
5657
- go build -i .
5758
- make check
5859
- if [ "$GOOS" = "linux" ]; then make check-protos check-api-descriptors; fi

Makefile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ include Makefile.$(target_os)
5656
TESTFLAGS ?= -v $(TESTFLAGS_RACE)
5757
TESTFLAGS_PARALLEL ?= 8
5858

59-
.PHONY: clean all AUTHORS fmt vet lint dco build binaries test integration setup generate protos checkprotos coverage ci check help install uninstall vendor release
59+
.PHONY: clean all AUTHORS fmt vet lint dco build binaries test integration generate protos checkprotos coverage ci check help install uninstall vendor release
6060
.DEFAULT: default
6161

6262
all: binaries
@@ -70,13 +70,6 @@ ci: check binaries checkprotos coverage coverage-integration ## to be used by th
7070
AUTHORS: .mailmap .git/HEAD
7171
git log --format='%aN <%aE>' | sort -fu > $@
7272

73-
setup: ## install dependencies
74-
@echo "$(WHALE) $@"
75-
# TODO(stevvooe): Install these from the vendor directory
76-
@go get -u github.com/alecthomas/gometalinter
77-
@gometalinter --install > /dev/null
78-
@go get -u github.com/stevvooe/protobuild
79-
8073
generate: protos
8174
@echo "$(WHALE) $@"
8275
@PATH=${ROOTDIR}/bin:${PATH} go generate -x ${PACKAGES}

script/setup/install-dev-tools

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Install developer tools to $GOBIN (or $GOPATH/bin if unset)
4+
#
5+
set -eu -o pipefail
6+
7+
go get -u github.com/stevvooe/protobuild
8+
go get -u github.com/alecthomas/gometalinter
9+
gometalinter --install >/dev/null
10+
go get -u github.com/LK4D4/vndr

script/validate/vendor

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
set -eu -o pipefail
3+
4+
rm -rf vendor/
5+
vndr |& grep -v -i clone
6+
7+
DIFF_PATH="vendor/"
8+
DIFF=$(git status --porcelain -- "$DIFF_PATH")
9+
10+
if [ "$DIFF" ]; then
11+
echo
12+
echo "These files were modified:"
13+
echo
14+
echo "$DIFF"
15+
echo
16+
exit 1
17+
else
18+
echo "$DIFF_PATH is correct"
19+
fi

vendor.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ github.com/BurntSushi/toml a368813c5e648fee92e5f6c30e3944ff9d5e8895
3636
github.com/grpc-ecosystem/go-grpc-prometheus 6b7015e65d366bf3f19b2b2a000a831940f0f7e0
3737
github.com/Microsoft/go-winio v0.4.4
3838
github.com/Microsoft/hcsshim v0.6.7
39-
github.com/Microsoft/opengcs v0.3.2
4039
github.com/boltdb/bolt e9cf4fae01b5a8ff89d0ec6b32f0d9c9f79aefdd
4140
google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944
4241
golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4

vendor/github.com/BurntSushi/toml/README.md

Lines changed: 8 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/BurntSushi/toml/doc.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/BurntSushi/toml/encode.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)