<commit_before>BIN = $(GOPATH)/bin
NODE_BIN = $(shell npm bin)
PID = .pid
GO_FILES = $(filter-out bindata.go, $(shell find src/app -type f -name "*.go"))
BINDATA = src/app/server/data/bindata.go
BINDATA_FLAGS = -pkg=data -prefix=src/app/server/data -ignore=src\\/app\\/server\\/data\\/bindata.go
BUNDLE = src/app/server/data/static/build/bundle.js
APP = $(shell find src/app/client -type f)

build: clean $(BIN)/app

clean:
	@rm -rf src/app/server/data/static/build/*
	@rm -rf src/app/server/data/bindata.go
	@echo cleaned

$(BUNDLE): $(APP)
	@$(NODE_BIN)/webpack --progress --colors

$(BIN)/app: $(BUNDLE) $(BINDATA)
	@go install -ldflags '-w' app

kill:
	@kill `cat $(PID)` || true

serve: clean $(BUNDLE)
	@make restart
	@$(NODE_BIN)/webpack-dev-server --config webpack.hot.config.js $$! > $(PID)_wds &
	@ANYBAR_WEBPACK=yep $(NODE_BIN)/webpack --progress --colors --watch $$! > $(PID)_wp &
	@fswatch $(GO_FILES) | xargs -n1 -I{} make restart || make kill
	@kill `cat $(PID)_wp` || true
	@kill `cat $(PID)_wds` || true

restart: BINDATA_FLAGS += -debug
restart: $(BINDATA)
	@make kill
	@go install app
	@$(BIN)/app run & echo $$! > $(PID)

$(BINDATA):
	$(BIN)/go-bindata $(BINDATA_FLAGS) -o=$@ src/app/server/data/...

lint:
	@eslint src/app/client
	@golint app/...<commit_msg>Golint settings<commit_after>BIN = $(GOPATH)/bin
NODE_BIN = $(shell npm bin)
PID = .pid
GO_FILES = $(filter-out bindata.go, $(shell find src/app -type f -name "*.go"))
BINDATA = src/app/server/data/bindata.go
BINDATA_FLAGS = -pkg=data -prefix=src/app/server/data -ignore=src\\/app\\/server\\/data\\/bindata.go
BUNDLE = src/app/server/data/static/build/bundle.js
APP = $(shell find src/app/client -type f)

build: clean $(BIN)/app

clean:
	@rm -rf src/app/server/data/static/build/*
	@rm -rf src/app/server/data/bindata.go
	@echo cleaned

$(BUNDLE): $(APP)
	@$(NODE_BIN)/webpack --progress --colors

$(BIN)/app: $(BUNDLE) $(BINDATA)
	@go install -ldflags '-w' app

kill:
	@kill `cat $(PID)` || true

serve: clean $(BUNDLE)
	@make restart
	@$(NODE_BIN)/webpack-dev-server --config webpack.hot.config.js $$! > $(PID)_wds &
	@ANYBAR_WEBPACK=yep $(NODE_BIN)/webpack --progress --colors --watch $$! > $(PID)_wp &
	@fswatch $(GO_FILES) | xargs -n1 -I{} make restart || make kill
	@kill `cat $(PID)_wp` || true
	@kill `cat $(PID)_wds` || true

restart: BINDATA_FLAGS += -debug
restart: $(BINDATA)
	@make kill
	@go install app
	@$(BIN)/app run & echo $$! > $(PID)

$(BINDATA):
	$(BIN)/go-bindata $(BINDATA_FLAGS) -o=$@ src/app/server/data/...

lint:
	@eslint src/app/client
	@golint -min_confidence=1 app
	@golint -min_confidence=1 app/server
	@golint -min_confidence=1 app/server/api
	@golint -min_confidence=1 app/server/utils
	@golint -min_confidence=1 app/server/react
{'fraction_non_alphanumeric': 0.20021881838074398, 'fraction_numerical': 0.002552881108679796, 'mean_word_length': 3.9069767441860463, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3236555', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1101, 'n_words': 249}