Install GoMetaLinter in Travis
And also rejigger the Makefiles to properly error if it's missing.
This commit is contained in:
parent
7fe8052941
commit
9179d58eb1
|
@ -3,8 +3,9 @@ go: 1.8.2
|
|||
before_install:
|
||||
# GoDep for Go dependency management.
|
||||
- go get -v github.com/tools/godep
|
||||
# Golint for good Go hygiene.
|
||||
- go get -v github.com/golang/lint/golint
|
||||
# Gometalinter for good Go linting/hygiene.
|
||||
- go get -v github.com/alecthomas/gometalinter
|
||||
- gometalinter --install
|
||||
# Node.js 7.x for LumiJS and associated JS code.
|
||||
- nvm install v7
|
||||
# Install Yarn as per https://yarnpkg.com/lang/en/docs/install-ci/#travis-tab.
|
||||
|
|
4
Makefile
4
Makefile
|
@ -1,3 +1,5 @@
|
|||
.SHELLFLAGS=-e
|
||||
|
||||
PROJECT=github.com/pulumi/lumi
|
||||
PROJECT_PKGS=$(shell go list ./cmd/... ./pkg/... | grep -v /vendor/)
|
||||
TESTPARALLELISM=10
|
||||
|
@ -34,6 +36,7 @@ install:
|
|||
.PHONY: lint
|
||||
lint:
|
||||
@echo "\033[0;32mLINT:\033[0m"
|
||||
which gometalinter >/dev/null
|
||||
gometalinter pkg/... | sort ; exit "$${PIPESTATUS[0]}"
|
||||
gometalinter cmd/lumi/... | sort ; exit "$${PIPESTATUS[0]}"
|
||||
gometalinter cmd/lumidl/... | sort ; exit "$${PIPESTATUS[0]}"
|
||||
|
@ -47,6 +50,7 @@ LINT_SUPPRESS="or be unexported|cyclomatic complexity|Subprocess launching with
|
|||
.PHONY: lint_quiet
|
||||
lint_quiet:
|
||||
@echo "\033[0;32mLINT (quiet):\033[0m"
|
||||
which gometalinter >/dev/null
|
||||
gometalinter pkg/... | grep -vE ${LINT_SUPPRESS} | sort
|
||||
gometalinter cmd/lumi/... | grep -vE ${LINT_SUPPRESS} | sort
|
||||
gometalinter cmd/lumidl/... | grep -vE ${LINT_SUPPRESS} | sort
|
||||
|
|
10
README.md
10
README.md
|
@ -34,11 +34,13 @@ This section is for Lumi developers.
|
|||
|
||||
### Prerequisites
|
||||
|
||||
Lumi is written in Go, uses Godep for dependency management, and Golint for linting:
|
||||
Lumi is written in Go, uses Godep for dependency management, and GoMetaLinter for linting:
|
||||
|
||||
* [Go](https://golang.org/doc/install): [download it](https://golang.org/dl)
|
||||
* [Godep](https://github.com/tools/godep): `$ go get github.com/tools/godep`
|
||||
* [Golint](https://github.com/golang/lint): `$ go get github.com/golang/lint/golint`
|
||||
* [Go](https://golang.org/doc/install): https://golang.org/dl
|
||||
* [Godep](https://github.com/tools/godep): `$ go get -v github.com/tools/godep`
|
||||
* [GoMetaLinter](https://github.com/alecthomas/gometalinter):
|
||||
- `$ go get -v github.com/golang/alecthomas/gometalinter`
|
||||
- `$ gometalinter --install`
|
||||
|
||||
### Building and Testing
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ install:
|
|||
lint:
|
||||
@echo "\033[0;32mLINT:\033[0m"
|
||||
./pack/node_modules/.bin/tslint './pack/**/*.ts' --exclude='./pack/node_modules/**'
|
||||
which gometalinter >/dev/null
|
||||
gometalinter provider/... | sort ; exit "$${PIPESTATUS[0]}"
|
||||
|
||||
# In quiet mode, suppress some messages.
|
||||
|
@ -59,6 +60,7 @@ LINT_SUPPRESS="or be unexported|cyclomatic complexity"
|
|||
lint_quiet:
|
||||
@echo "\033[0;32mLINT (quiet):\033[0m"
|
||||
./pack/node_modules/.bin/tslint './pack/**/*.ts' --exclude='./pack/node_modules/**'
|
||||
which gometalinter >/dev/null
|
||||
gometalinter provider/... | grep -vE ${LINT_SUPPRESS} | sort
|
||||
@test -z "$$(gometalinter provider/... | grep -vE ${LINT_SUPPRESS})"
|
||||
@echo "\033[0;33mgolint was run quietly; to run with noisy errors, run 'make lint'\033[0m"
|
||||
|
|
Loading…
Reference in a new issue