<commit_before>version=$(shell git -C $(CURDIR) describe --abbrev=0)
all: clean build lint test

clean:
	go clean

gen:
	if [ -d "corcel-reports-workbench" ]; then \
		(cd corcel-reports-workbench && git pull) \
	else \
		git clone <EMAIL>:guzzler/corcel-reports-workbench.git; \
	fi
	cd corcel-reports-workbench && npm install -d && npm install gulp && npm install -g gulp-cli && gulp && cp out/index.html ../report/data/corcel.layout.mustache.html


build: 
	#clean lint generate
	#version=`grep -Po "(?<=version=)[0-9.]+" version`
	#go build -ldflags="-X main.Version=${version}"
	go build -ldflags "-X main.BuildTime=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X main.CommitHash=`git rev-parse HEAD` -X main.Version=`git describe --tags`"

test: build 
	go get github.com/onsi/ginkgo/ginkgo
	go get github.com/onsi/gomega
	ginkgo -cover -r --race -noisyPendings=false -slowSpecThreshold=10

generate:
	go get -u github.com/jteeuwen/go-bindata/...
	(cd report && go-bindata -pkg report data)

lint: generate
	go get -u github.com/alecthomas/gometalinter
	go get -t ./...
	gometalinter --install
	gometalinter -e "duplicate" -e "undeclared name: Asset" -e "_test" --deadline=30s<commit_msg>Debugging the tests failing on travis but not locally<commit_after>version=$(shell git -C $(CURDIR) describe --abbrev=0)
all: clean build lint test

clean:
	go clean

gen:
	if [ -d "corcel-reports-workbench" ]; then \
		(cd corcel-reports-workbench && git pull) \
	else \
		git clone git<EMAIL>:guzzler/corcel-reports-workbench.git; \
	fi
	cd corcel-reports-workbench && npm install -d && npm install gulp && npm install -g gulp-cli && gulp && cp out/index.html ../report/data/corcel.layout.mustache.html


build: 
	#clean lint generate
	#version=`grep -Po "(?<=version=)[0-9.]+" version`
	#go build -ldflags="-X main.Version=${version}"
	go build -ldflags "-X panicNotRecover='1' -X main.BuildTime=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X main.CommitHash=`git rev-parse HEAD` -X main.Version=`git describe --tags`"

test: build 
	go get github.com/onsi/ginkgo/ginkgo
	go get github.com/onsi/gomega
	ginkgo -cover -r --race -noisyPendings=false -slowSpecThreshold=10

generate:
	go get -u github.com/jteeuwen/go-bindata/...
	(cd report && go-bindata -pkg report data)

lint: generate
	go get -u github.com/alecthomas/gometalinter
	go get -t ./...
	gometalinter --install
	gometalinter -e "duplicate" -e "undeclared name: Asset" -e "_test" --deadline=30s
{'fraction_non_alphanumeric': 0.16049382716049382, 'fraction_numerical': 0.006172839506172839, 'mean_word_length': 3.7112403100775193, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '385873', 'n_tokens_mistral': 969, 'n_tokens_neox': 912, 'n_words': 243}