<commit_before>E2E_TEST_ARGS=-v
GO_TEST_ARGS=-v
GO_TEST_PACKAGES=$(shell glide novendor | grep -v e2e)
DB_HOST=192.168.99.100
LINT_PACKAGES=$(shell glide novendor)

all: install

.PHONY: install

setup:
	go get github.com/Masterminds/glide
	go get golang.org/x/tools/cmd/goimports
	glide install
	go install ./vendor/bitbucket.org/liamstask/goose/cmd/goose
	go install ./vendor/github.com/cespare/reflex
	go install ./vendor/honnef.co/go/tools/cmd/staticcheck
	go install ./vendor/honnef.co/go/tools/cmd/gosimple
	go install ./vendor/honnef.co/go/tools/cmd/unused

serve:
	go run server/cmd/lekcije/main.go

install:
	go install github.com/oinume/lekcije/server/cmd/lekcije

e2e_test: minify_static_development
	go test $(E2E_TEST_ARGS) github.com/oinume/lekcije/e2e

go_test:
	go test -race $(GO_TEST_ARGS) $(GO_TEST_PACKAGES)

goimports:
	goimports -w ./server ./e2e

go_lint:
	go vet -v $(LINT_PACKAGES)
	staticcheck $(LINT_PACKAGES)
	gosimple $(LINT_PACKAGES)

minify_static_development:
	MINIFY=true VERSION_HASH=_version_ npm run build

minify_static:
	MINIFY=true VERSION_HASH=$(shell git rev-parse HEAD) npm run build

reset_db:
	mysql -h $(DB_HOST) -P 13306 -uroot -proot -e "DROP DATABASE IF EXISTS lekcije"
	mysql -h $(DB_HOST) -P 13306 -uroot -proot -e "DROP DATABASE IF EXISTS lekcije_test"
	mysql -h $(DB_HOST) -P 13306 -uroot -proot < db/create_database.sql
<commit_msg>Organize Makefile<commit_after>E2E_TEST_ARGS=-v
GO_TEST_ARGS=-v
GO_TEST_PACKAGES=$(shell glide novendor | grep -v e2e)
DB_HOST=192.168.99.100
LINT_PACKAGES=$(shell glide novendor)

all: install

.PHONY: setup
setup:
	go get github.com/Masterminds/glide
	go get golang.org/x/tools/cmd/goimports
	glide install
	go install ./vendor/bitbucket.org/liamstask/goose/cmd/goose
	go install ./vendor/github.com/cespare/reflex
	go install ./vendor/honnef.co/go/tools/cmd/staticcheck
	go install ./vendor/honnef.co/go/tools/cmd/gosimple
	go install ./vendor/honnef.co/go/tools/cmd/unused

.PHONY: serve
serve:
	go run server/cmd/lekcije/main.go

.PHONY: install
install:
	go install github.com/oinume/lekcije/server/cmd/lekcije

.PHONY: e2e_test
e2e_test: minify_static_development
	go test $(E2E_TEST_ARGS) github.com/oinume/lekcije/e2e

.PHONY: go_test
go_test:
	go test -race $(GO_TEST_ARGS) $(GO_TEST_PACKAGES)

.PHONY: goimports
goimports:
	goimports -w ./server ./e2e

.PHONY: go_lint
go_lint:
	go vet -v $(LINT_PACKAGES)
	staticcheck $(LINT_PACKAGES)
	gosimple $(LINT_PACKAGES)

.PHONY: minify_static_development
minify_static_development:
	MINIFY=true VERSION_HASH=_version_ npm run build

.PHONY: minify_static
minify_static:
	MINIFY=true VERSION_HASH=$(shell git rev-parse HEAD) npm run build

.PHONY: reset_db
reset_db:
	mysql -h $(DB_HOST) -P 13306 -uroot -proot -e "DROP DATABASE IF EXISTS lekcije"
	mysql -h $(DB_HOST) -P 13306 -uroot -proot -e "DROP DATABASE IF EXISTS lekcije_test"
	mysql -h $(DB_HOST) -P 13306 -uroot -proot < db/create_database.sql
{'fraction_non_alphanumeric': 0.11292517006802721, 'fraction_numerical': 0.022108843537414966, 'mean_word_length': 4.580645161290323, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '6548739', 'n_tokens_mistral': 1304, 'n_tokens_neox': 1218, 'n_words': 267}