2017-06-27 19:25:07 +02:00
|
|
|
SOURCEDIR=.
|
|
|
|
SOURCES := $(shell find $(SOURCEDIR) -name '*.go')
|
|
|
|
|
2017-07-05 19:46:30 +02:00
|
|
|
LIB = liquid
|
2022-01-06 18:43:17 +01:00
|
|
|
PACKAGE = github.com/danog/liquid
|
2017-07-05 19:46:30 +02:00
|
|
|
LDFLAGS=
|
2017-06-27 19:25:07 +02:00
|
|
|
|
2017-06-28 00:10:12 +02:00
|
|
|
.DEFAULT_GOAL: ci
|
2018-06-05 21:47:13 +02:00
|
|
|
.PHONY: ci clean coverage deps generate imports install lint pre-commit setup test help
|
2017-06-27 19:25:07 +02:00
|
|
|
|
|
|
|
clean: ## remove binary files
|
2017-07-05 19:46:30 +02:00
|
|
|
rm -f ${LIB} ${CMD}
|
2017-06-27 19:25:07 +02:00
|
|
|
|
2018-06-05 21:47:13 +02:00
|
|
|
coverage: ## test the package, with coverage
|
|
|
|
go test -cov ./...
|
|
|
|
|
2017-06-29 17:15:13 +02:00
|
|
|
deps: ## list dependencies
|
2017-07-20 03:32:45 +02:00
|
|
|
@go list -f '{{join .Deps "\n"}}' ./... | grep -v `go list -f '{{.ImportPath}}'` | grep '\.' | sort | uniq
|
2017-07-14 02:18:23 +02:00
|
|
|
|
2021-06-26 09:24:21 +02:00
|
|
|
format: ## list dependencies
|
|
|
|
@go fmt
|
|
|
|
|
2018-06-05 21:47:13 +02:00
|
|
|
generate: ## re-generate lexers and parser
|
|
|
|
go generate ./...
|
|
|
|
|
2017-07-14 02:18:23 +02:00
|
|
|
imports: ## list imports
|
2017-07-20 03:32:45 +02:00
|
|
|
@go list -f '{{join .Imports "\n"}}' ./... | grep -v `go list -f '{{.ImportPath}}'` | grep '\.' | sort | uniq
|
2017-06-29 17:15:13 +02:00
|
|
|
|
2018-06-05 21:47:13 +02:00
|
|
|
lint: ## lint the package
|
2021-06-16 12:42:31 +02:00
|
|
|
golangci-lint run
|
2018-06-05 21:47:13 +02:00
|
|
|
@echo lint passed
|
|
|
|
|
|
|
|
pre-commit: lint test ## lint and test the package
|
2017-07-13 02:04:55 +02:00
|
|
|
|
|
|
|
setup: ## install dependencies and development tools
|
2022-02-11 10:29:44 +01:00
|
|
|
go install golang.org/x/tools/cmd/stringer
|
2017-06-27 19:25:07 +02:00
|
|
|
go install golang.org/x/tools/cmd/goyacc
|
2017-07-16 03:13:03 +02:00
|
|
|
go get -t ./...
|
2017-06-27 19:25:07 +02:00
|
|
|
|
|
|
|
test: ## test the package
|
|
|
|
go test ./...
|
|
|
|
|
|
|
|
# Source: https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
|
|
|
|
help:
|
|
|
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|