Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ go:
sudo: false

before_install:
- go version | (grep -q 'go1.[56]' || exit 0 && go get -u github.com/golang/lint/golint )
- go get -u github.com/vbatts/git-validation
- make install.tools

install: true

script:
- go vet -x ./...
- make .govet
- make .golint
- git-validation -run DCO,short-subject,dangling-whitespace -v
- make .gitvalidation

47 changes: 35 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,32 @@ DOC_FILES := \
config.md \
config-linux.md \
glossary.md
EPOCH_TEST_COMMIT := 041eb73d2e0391463894c04c8ac938036143eba3
EPOCH_TEST_COMMIT := 78e6667ae2d67aad100b28ee9580b41b7a24e667

default: docs

docs: pdf html
.PHONY: docs
docs: output/docs.pdf output/docs.html

pdf:
@mkdir -p output/ && \
output/docs.pdf:
mkdir -p output/ && \
$(DOCKER) run \
-it \
--rm \
-v $(shell pwd)/:/input/:ro \
-v $(shell pwd)/output/:/output/ \
-u $(shell id -u) \
vbatts/pandoc -f markdown_github -t latex -o /output/docs.pdf $(patsubst %,/input/%,$(DOC_FILES)) && \
ls -sh $(shell readlink -f output/docs.pdf)
vbatts/pandoc -f markdown_github -t latex -o /$@ $(patsubst %,/input/%,$(DOC_FILES))

html:
@mkdir -p output/ && \
output/docs.html:
mkdir -p output/ && \
$(DOCKER) run \
-it \
--rm \
-v $(shell pwd)/:/input/:ro \
-v $(shell pwd)/output/:/output/ \
-u $(shell id -u) \
vbatts/pandoc -f markdown_github -t html5 -o /output/docs.html $(patsubst %,/input/%,$(DOC_FILES)) && \
ls -sh $(shell readlink -f output/docs.html)
vbatts/pandoc -f markdown_github -t html5 -o /$@ $(patsubst %,/input/%,$(DOC_FILES))


HOST_GOLANG_VERSION = $(shell go version | cut -d ' ' -f3 | cut -c 3-)
Expand All @@ -53,19 +53,42 @@ test: .govet .golint .gitvalidation

# `go get golang.org/x/tools/cmd/vet`
.govet:
@go tool | grep -qw vet || (echo "ERROR: 'go vet' not found. Consider 'make install.tools' target" && false)
go vet -x ./...

# `go get github.com/golang/lint/golint`
.golint:
ifeq ($(call ALLOWED_GO_VERSION,1.5,$(HOST_GOLANG_VERSION)),true)
@which golint > /dev/null 2>/dev/null || (echo "ERROR: golint not found. Consider 'make install.tools' target" && false)
golint ./...
endif


# `go get github.com/vbatts/git-validation`
# When this is running in travis, it will only check the travis commit range
.gitvalidation:
git-validation -q -run DCO,short-subject -v -range $(EPOCH_TEST_COMMIT)..HEAD
@which git-validation > /dev/null 2>/dev/null || (echo "ERROR: git-validation not found. Consider 'make install.tools' target" && false)
git-validation -q -run DCO,short-subject,dangling-whitespace -v -range $(EPOCH_TEST_COMMIT)..HEAD

.PHONY: install.tools
install.tools: .install.golint .install.govet .install.gitvalidation

# golint does not even build for <go1.5
.install.golint:
ifeq ($(call ALLOWED_GO_VERSION,1.5,$(HOST_GOLANG_VERSION)),true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably just remove the ALLOWED_GO_VERSION stuff, since c506ce6 (Fix the build by getting rid of go get for vet, 2016-04-07, #372) completely dropped Go < 1.5. We can always drag it out of the PR history if we need that sort of logic to partially support Go 1.5 (or whatever) in the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's being used on the install of go vet, and someone's local go version
may vary.

On Tue, Apr 12, 2016 at 1:11 AM, W. Trevor King [email protected]
wrote:

In Makefile
#349 (comment)
:

git-validation -q -run DCO,short-subject -v -range $(EPOCH_TEST_COMMIT)..HEAD

+.PHONY: install.tools
+install.tools: .install.golint .install.govet .install.gitvalidation
+
+# golint does not even build for <go1.5
+.install.golint:
+ifeq ($(call ALLOWED_GO_VERSION,1.5,$(HOST_GOLANG_VERSION)),true)

We can probably just remove the ALLOWED_GO_VERSION stuff, since c506ce6
c506ce6
(Fix the build by getting rid of go get for vet, 2016-04-07, #372
#372) completely
dropped Go < 1.5. We can always drag it out of the PR history if we need
that sort of logic to partially support Go 1.5 (or whatever) in the future.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/opencontainers/runtime-spec/pull/349/files/8f70c5f3d3a7b083248ca79edd1b9a261da4de09#r59321441

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Tue, Apr 12, 2016 at 06:49:07AM -0700, Vincent Batts wrote:

it's being used on the install of go vet, and someone's local go
version may vary.

Ah, good point. I guess folks might be running these checks outside
of Travis ;).

go get github.com/golang/lint/golint
endif

# go vet is now included in >=go1.5, so no need to get it.
.install.govet:
ifeq ($(call ALLOWED_GO_VERSION,1.5,$(HOST_GOLANG_VERSION)),true)
go get golang.org/x/tools/cmd/vet
endif

.install.gitvalidation:
go get github.com/vbatts/git-validation


.PHONY: clean
clean:
rm -rf output/ *~