Skip to content

Commit bc1047a

Browse files
authored
[Feature] Use go dep as vendor (#264)
1 parent 71f82f8 commit bc1047a

File tree

6,624 files changed

+432
-1614503
lines changed

Some content is hidden

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

6,624 files changed

+432
-1614503
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.gobuild
22
/arangodb
3-
bin
3+
bin
4+
vendor/

deps/github.com/arangodb/go-velocypack/doc.go renamed to LICENSE.BOILERPLATE

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2017 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2020 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -17,10 +17,3 @@
1717
//
1818
// Copyright holder is ArangoDB GmbH, Cologne, Germany
1919
//
20-
// Author Ewout Prangsma
21-
//
22-
23-
/*
24-
Velocypack implementation for Go.
25-
*/
26-
package velocypack

Makefile

Lines changed: 51 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ TESTBIN := $(BINDIR)/$(GOOS)/$(GOARCH)/$(TESTNAME)
5353
RELEASE := $(GOBUILDDIR)/bin/release
5454
GHRELEASE := $(GOBUILDDIR)/bin/github-release
5555

56+
GO_IGNORED:=vendor .gobuild
57+
58+
GO_SOURCES_QUERY := find $(SRCDIR) -name '*.go' -type f $(foreach IGNORED,$(GO_IGNORED),-not -path '$(SRCDIR)/$(IGNORED)/*' )
59+
GO_SOURCES := $(shell $(GO_SOURCES_QUERY) | sort | uniq)
60+
GO_SOURCES_PACKAGES := $(shell $(GO_SOURCES_QUERY) -exec dirname {} \; | sort | uniq)
61+
5662
SOURCES := $(shell find $(SRCDIR) -name '*.go' -not -path './test/*')
5763
TEST_SOURCES := $(shell find $(SRCDIR)/test -name '*.go')
5864

@@ -89,7 +95,7 @@ GHRELEASE_BIN := /usr/code/.gobuild/bin/github-release
8995
DOCKER_CMD = $(DOCKERCLI) run \
9096
--rm \
9197
-v $(SRCDIR):/usr/code \
92-
-u "$(shell id -u)" \
98+
-u "$(shell id -u):$(shell id -g)" \
9399
-e GOCACHE=/usr/code/.gobuild/.cache \
94100
-e GOPATH=/usr/code/.gobuild \
95101
-e GOOS=$(GOOS) \
@@ -118,9 +124,9 @@ endif
118124
build-local: build
119125
@ln -sf "$(BIN)" "$(ROOTDIR)/arangodb"
120126

121-
build: $(BIN)
127+
build: vendor $(BIN)
122128

123-
build-test: $(TESTBIN)
129+
build-test: vendor $(TESTBIN)
124130

125131
binaries: $(GHRELEASE)
126132
@${MAKE} -f $(MAKEFILE) -B GOOS=linux GOARCH=amd64 build
@@ -134,48 +140,13 @@ binaries-test: $(GHRELEASE)
134140
@${MAKE} -f $(MAKEFILE) -B GOOS=darwin GOARCH=amd64 build-test
135141
@${MAKE} -f $(MAKEFILE) -B GOOS=windows GOARCH=amd64 build-test
136142

137-
deps:
138-
@${MAKE} -f $(MAKEFILE) -B SCRIPTDIR=$(SCRIPTDIR) BUILDDIR=$(BUILDDIR) -s $(GOBUILDDIR)
139-
140-
$(GOBUILDDIR):
141-
@mkdir -p $(ORGDIR)
142-
@mkdir -p $(GOBUILDDIR)/src/golang.org
143-
@mkdir -p $(GOBUILDDIR)/src/github.com/arangodb
144-
@rm -f $(REPODIR) && ln -s $(GOBUILDLINKTARGET) $(REPODIR)
145-
@rm -f $(GOBUILDDIR)/src/github.com/aktau && ln -s ../../../deps/github.com/aktau $(GOBUILDDIR)/src/github.com/aktau
146-
@rm -f $(GOBUILDDIR)/src/github.com/arangodb/go-driver && ln -s ../../../../deps/github.com/arangodb/go-driver $(GOBUILDDIR)/src/github.com/arangodb/go-driver
147-
@rm -f $(GOBUILDDIR)/src/github.com/arangodb/go-velocypack && ln -s ../../../../deps/github.com/arangodb/go-velocypack $(GOBUILDDIR)/src/github.com/arangodb/go-velocypack
148-
@rm -f $(GOBUILDDIR)/src/github.com/arangodb-helper/go-certificates && ln -s ../../../../deps/github.com/arangodb-helper/go-certificates $(GOBUILDDIR)/src/github.com/arangodb-helper/go-certificates
149-
@rm -f $(GOBUILDDIR)/src/github.com/cenkalti && ln -s ../../../deps/github.com/cenkalti $(GOBUILDDIR)/src/github.com/cenkalti
150-
@rm -f $(GOBUILDDIR)/src/github.com/coreos && ln -s ../../../deps/github.com/coreos $(GOBUILDDIR)/src/github.com/coreos
151-
@rm -f $(GOBUILDDIR)/src/github.com/dchest && ln -s ../../../deps/github.com/dchest $(GOBUILDDIR)/src/github.com/dchest
152-
@rm -f $(GOBUILDDIR)/src/github.com/dgrijalva && ln -s ../../../deps/github.com/dgrijalva $(GOBUILDDIR)/src/github.com/dgrijalva
153-
@rm -f $(GOBUILDDIR)/src/github.com/docker && ln -s ../../../deps/github.com/docker $(GOBUILDDIR)/src/github.com/docker
154-
@rm -f $(GOBUILDDIR)/src/github.com/dustin && ln -s ../../../deps/github.com/dustin $(GOBUILDDIR)/src/github.com/dustin
155-
@rm -f $(GOBUILDDIR)/src/github.com/fatih && ln -s ../../../deps/github.com/fatih $(GOBUILDDIR)/src/github.com/fatih
156-
@rm -f $(GOBUILDDIR)/src/github.com/fsouza && ln -s ../../../deps/github.com/fsouza $(GOBUILDDIR)/src/github.com/fsouza
157-
@rm -f $(GOBUILDDIR)/src/github.com/hashicorp && ln -s ../../../deps/github.com/hashicorp $(GOBUILDDIR)/src/github.com/hashicorp
158-
@rm -f $(GOBUILDDIR)/src/github.com/inconshreveable && ln -s ../../../deps/github.com/inconshreveable $(GOBUILDDIR)/src/github.com/inconshreveable
159-
@rm -f $(GOBUILDDIR)/src/github.com/mitchellh && ln -s ../../../deps/github.com/mitchellh $(GOBUILDDIR)/src/github.com/mitchellh
160-
@rm -f $(GOBUILDDIR)/src/github.com/Microsoft && ln -s ../../../deps/github.com/Microsoft $(GOBUILDDIR)/src/github.com/Microsoft
161-
@rm -f $(GOBUILDDIR)/src/github.com/kballard && ln -s ../../../deps/github.com/kballard $(GOBUILDDIR)/src/github.com/kballard
162-
@rm -f $(GOBUILDDIR)/src/github.com/pavel-v-chernykh && ln -s ../../../deps/github.com/pavel-v-chernykh $(GOBUILDDIR)/src/github.com/pavel-v-chernykh
163-
@rm -f $(GOBUILDDIR)/src/github.com/pkg && ln -s ../../../deps/github.com/pkg $(GOBUILDDIR)/src/github.com/pkg
164-
@rm -f $(GOBUILDDIR)/src/github.com/rs && ln -s ../../../deps/github.com/rs $(GOBUILDDIR)/src/github.com/rs
165-
@rm -f $(GOBUILDDIR)/src/github.com/shavac && ln -s ../../../deps/github.com/shavac $(GOBUILDDIR)/src/github.com/shavac
166-
@rm -f $(GOBUILDDIR)/src/github.com/spf13 && ln -s ../../../deps/github.com/spf13 $(GOBUILDDIR)/src/github.com/spf13
167-
@rm -f $(GOBUILDDIR)/src/github.com/ryanuber && ln -s ../../../deps/github.com/ryanuber $(GOBUILDDIR)/src/github.com/ryanuber
168-
@rm -f $(GOBUILDDIR)/src/github.com/voxelbrain && ln -s ../../../deps/github.com/voxelbrain $(GOBUILDDIR)/src/github.com/voxelbrain
169-
@rm -f $(GOBUILDDIR)/src/golang.org/x && ln -s ../../../deps/golang.org/x $(GOBUILDDIR)/src/golang.org/x
170-
$(DOCKER_CMD) go get github.com/arangodb/go-upgrade-rules
171-
172143
$(BIN): $(GOBUILDDIR) $(SOURCES)
173144
@mkdir -p $(BINDIR)
174-
$(DOCKER_CMD) go build -installsuffix netgo -tags netgo -ldflags "-X main.projectVersion=$(VERSION) -X main.projectBuild=$(COMMIT)" -o "$(BUILD_BIN)" $(REPOPATH)
145+
$(DOCKER_CMD) go build -installsuffix netgo -tags netgo -ldflags "-X main.projectVersion=$(VERSION) -X main.projectBuild=$(COMMIT)" -o "$(BUILD_BIN)" .
175146

176147
$(TESTBIN): $(GOBUILDDIR) $(TEST_SOURCES) $(BIN)
177148
@mkdir -p $(BINDIR)
178-
$(DOCKER_CMD) go test -c -o "$(TEST_BIN)" $(REPOPATH)/test
149+
$(DOCKER_CMD) go test -c -o "$(TEST_BIN)" ./test
179150

180151
docker: build
181152
$(DOCKERCLI) build -t arangodb/arangodb-starter .
@@ -241,3 +212,43 @@ run-tests-docker: docker _run-tests
241212
run-tests-local: export TEST_MODES=localprocess
242213
run-tests-local: _run-tests
243214

215+
## LINT
216+
217+
GOLANGCI_ENABLED=deadcode gocyclo golint varcheck structcheck maligned errcheck \
218+
ineffassign interfacer unconvert goconst \
219+
megacheck
220+
221+
.PHONY: tools
222+
tools:
223+
@echo ">> Fetching goimports"
224+
@go get -u golang.org/x/tools/cmd/goimports
225+
@echo ">> Fetching license check"
226+
@go get -u github.com/google/addlicense
227+
@echo ">> Fetching github release"
228+
@go get -u github.com/aktau/github-release
229+
230+
.PHONY: license-verify
231+
license-verify:
232+
@echo ">> Verify license of files"
233+
@go run github.com/google/addlicense -f "./LICENSE.BOILERPLATE" -check $(GO_SOURCES)
234+
235+
.PHONY: fmt
236+
fmt:
237+
@echo ">> Ensuring style of files"
238+
@go run golang.org/x/tools/cmd/goimports -w $(GO_SOURCES)
239+
240+
.PHONY: fmt-verify
241+
fmt-verify: license-verify
242+
@echo ">> Verify files style"
243+
@if [ X"$$(go run golang.org/x/tools/cmd/goimports -l $(GO_SOURCES) | wc -l)" != X"0" ]; then echo ">> Style errors"; go run golang.org/x/tools/cmd/goimports -l $(GO_SOURCES); exit 1; fi
244+
245+
.PHONY: linter
246+
linter: fmt
247+
@golangci-lint run --no-config --issues-exit-code=1 --deadline=30m --disable-all \
248+
$(foreach MODE,$(GOLANGCI_ENABLED),--enable $(MODE) ) \
249+
--exclude-use-default=false \
250+
$(GO_SOURCES_PACKAGES)
251+
252+
.PHONY: vendor
253+
vendor:
254+
@go mod vendor

deps/github.com/Microsoft/go-winio/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

deps/github.com/Microsoft/go-winio/LICENSE

Lines changed: 0 additions & 22 deletions
This file was deleted.

deps/github.com/Microsoft/go-winio/README.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

deps/github.com/Microsoft/go-winio/archive/tar/LICENSE

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)