mirror of
https://github.com/danog/liquid.git
synced 2024-11-30 08:39:01 +01:00
Add make pre-commit; lint before testing
This commit is contained in:
parent
ca945a04d1
commit
20a3b002f5
@ -9,8 +9,8 @@ install:
|
||||
- make setup
|
||||
|
||||
script:
|
||||
- $HOME/gopath/bin/goveralls -service=travis-ci
|
||||
- make lint
|
||||
- $HOME/gopath/bin/goveralls -service=travis-ci
|
||||
|
||||
notifications:
|
||||
email:
|
||||
|
@ -25,6 +25,12 @@ Install package dependencies and development tools:
|
||||
|
||||
### Test and Lint
|
||||
|
||||
```bash
|
||||
make pre-commit
|
||||
```
|
||||
|
||||
You can also do these individually:
|
||||
|
||||
```bash
|
||||
go test ./...
|
||||
make lint
|
||||
|
21
Makefile
21
Makefile
@ -6,21 +6,28 @@ PACKAGE = github.com/osteele/liquid
|
||||
LDFLAGS=
|
||||
|
||||
.DEFAULT_GOAL: ci
|
||||
.PHONY: clean ci deps setup install lint test help
|
||||
|
||||
ci: setup test #lint
|
||||
.PHONY: ci clean coverage deps generate imports install lint pre-commit setup test help
|
||||
|
||||
clean: ## remove binary files
|
||||
rm -f ${LIB} ${CMD}
|
||||
|
||||
coverage: ## test the package, with coverage
|
||||
go test -cov ./...
|
||||
|
||||
deps: ## list dependencies
|
||||
@go list -f '{{join .Deps "\n"}}' ./... | grep -v `go list -f '{{.ImportPath}}'` | grep '\.' | sort | uniq
|
||||
|
||||
generate: ## re-generate lexers and parser
|
||||
go generate ./...
|
||||
|
||||
imports: ## list imports
|
||||
@go list -f '{{join .Imports "\n"}}' ./... | grep -v `go list -f '{{.ImportPath}}'` | grep '\.' | sort | uniq
|
||||
|
||||
generate:
|
||||
go generate ./...
|
||||
lint: ## lint the package
|
||||
gometalinter ./... --tests --deadline=5m --include=gofmt --exclude expressions/scanner.go --exclude y.go --exclude '.*_string.go' --disable=gotype --disable=interfacer
|
||||
@echo lint passed
|
||||
|
||||
pre-commit: lint test ## lint and test the package
|
||||
|
||||
setup: ## install dependencies and development tools
|
||||
go get golang.org/x/tools/cmd/stringer
|
||||
@ -29,10 +36,6 @@ setup: ## install dependencies and development tools
|
||||
go get github.com/alecthomas/gometalinter
|
||||
gometalinter --install
|
||||
|
||||
lint: ## lint the package
|
||||
gometalinter ./... --tests --deadline=5m --include=gofmt --exclude expressions/scanner.go --exclude y.go --exclude '.*_string.go' --disable=gotype --disable=interfacer
|
||||
@echo lint passed
|
||||
|
||||
test: ## test the package
|
||||
go test ./...
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user