<commit_before>SHELL := /bin/sh
GOPROCS := 4
SRC := $(wildcard *.go)
COVFILE := coverage.out
GOFILES_NOVENDOR := $(shell find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./example/*")

.PHONY: get-deps
get-deps:
	go get -t ./...
	go get golang.org/x/tools/cmd/goimports
	go get -u golang.org/x/lint/golint

.PHONY: clean
clean:
	go clean -i ./...

.PHONY: cov
cov: $(COVFILE)
	go tool cover -func=$(COVFILE)
	sed -i '\|github.com/cycloidio/raws/generate.go|d' $(COVFILE)

.PHONY: htmlcov
htmlcov: $(COVFILE)
	go tool cover -html=$(COVFILE)

$(COVFILE):
	go test ./... -covermode=count -coverprofile=$(COVFILE)

.PHONY: travis-ci
travis-ci: test vetcheck fmtcheck lintcheck cov

.PHONY: test
test:
	go test -v ./... -coverprofile=$(COVFILE)

.PHONY: fmtcheck
fmtcheck:
	@if [ "$(shell goimports -l $(GOFILES_NOVENDOR) | wc -l)" != "0" ]; then \
		echo "Files missing go fmt: $(shell goimports -l $(GOFILES_NOVENDOR))"; exit 2; \
	else \
	    echo -e "ok\tall files passed go fmt"; \
	fi

.PHONY: vetcheck
vetcheck:
ifeq ($(shell go tool vet -all -shadow=true . 2>&1 | wc -l), 0)
	@printf "ok\tall files passed go vet\n"
else
	@echo -e "error\tsome files did not pass go vet\n"
	@go tool vet -all -shadow=true . 2>&1
endif

.PHONY: lintcheck
lintcheck:
ifeq ($(shell golint 2>&1 | wc -l), 0)
	@printf "ok\tall files passed golint\n"
else
	@echo -e "error\tsome files did not pass golint\n"
	@golint 2>&1
endif

.PHONY: generate
generate:
	@go generate ./...<commit_msg>Makefile: Add GO111MODULE to the needed targets<commit_after>SHELL := /bin/sh
GOPROCS := 4
COVFILE := coverage.out

.PHONY: get-deps
get-deps:
	go get -u golang.org/x/tools/cmd/goimports
	go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
	go get -u golang.org/x/lint/golint

.PHONY: clean
clean:
	go clean -i ./...

.PHONY: cov
cov: $(COVFILE)
	go tool cover -func=$(COVFILE)
	sed -i '\|github.com/cycloidio/raws/generate.go|d' $(COVFILE)

.PHONY: htmlcov
htmlcov: $(COVFILE)
	@go tool cover -html=$(COVFILE)

$(COVFILE):
	@GO111MODULE=on go test ./... -covermode=count -coverprofile=$(COVFILE)

.PHONY: travis-ci
travis-ci: lintcheck test cov

.PHONY: test
test:
	@GO111MODULE=on go test ./... -coverprofile=$(COVFILE)

.PHONY: lintcheck
lintcheck:
	@GO111MODULE=on golangci-lint run ./... -E goimports && \
		golint -set_exit_status ./...

.PHONY: generate
generate:
	@GO111MODULE=on go generate ./...
{'fraction_non_alphanumeric': 0.17271589486858574, 'fraction_numerical': 0.012098456403838132, 'mean_word_length': 3.3442028985507246, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2152328', 'n_tokens_mistral': 1035, 'n_tokens_neox': 1009, 'n_words': 270}