<commit_before># Developer Makefile

### Default Configuration.  Override in a make.config file

# the path to the lib folder in the venv
LOCAL_LIB=$(VIRTUAL_ENV)/lib

# where executables are stored
LOCAL_BIN=$(VIRTUAL_ENV)/bin

# where source files are stored
LOCAL_SRC=$(VIRTUAL_ENV)/src

NPM_BIN := $(or $(shell command -v npm),$(LOCAL_BIN)/npm)
LESS_BIN := $(or $(shell command -v lessc),$(LOCAL_BIN)/lessc)
JSHINT_BIN := $(or $(shell command -v jshint),$(LOCAL_BIN)/jshint)
WATCHMEDO_BIN := $(or $(shell command -v watchmedo),$(LOCAL_BIN)/watchmedo)

# allows a file make.config to override the above variables
-include make.config

### PIP
.pip-timestamp: requirements.txt
	pip install -r requirements.txt
	touch .pip-timestamp

pip-install: .pip-timestamp

$(LOCAL_BIN)/sphinx-build:
	pip install Sphinx

### GENERAL PYTHON COMMANDS
clean-pyc:
	find . -name '*.pyc' -exec rm -f {} +
	find . -name '*.pyo' -exec rm -f {} +
	find . -name '*~' -exec rm -f {} +

### GO SUPPORT

$(LOCAL_BIN)/botbot-bot:
	GOPATH=$(VIRTUAL_ENV) go get github.com/BotBotMe/botbot-bot

test-bot:
	GOPATH=$(VIRTUAL_ENV) go test github.com/BotBotMe/botbot-bot

$(LOCAL_BIN)/botbot-eventsource:
	GOPATH=$(VIRTUAL_ENV) go get github.com/BotBotMe/botbot-eventsource

### LOCAL LESS SUPPORT
$(NPM_BIN):
	@echo "Installing node.js..."
	cd $(VIRTUAL_ENV) && mkdir -p "src"
	cd $(LOCAL_LIB) && curl http://nodejs.org/dist/node-latest.tar.gz | tar xvz
	cd $(LOCAL_LIB)/node-v* && ./configure --prefix=$(VIRTUAL_ENV) && make install
	@echo "Installed npm"

$(LESS_BIN): $(NPM_BIN)
	NPM_CONFIG_PREFIX=$(VIRTUAL_ENV) npm install "less@<1.4" -g

less-install: $(LESS_BIN)

less-compile:
	lessc botbot/less/screen.less > botbot/static/css/screen.css

$(WATCHMEDO_BIN):
	# Install watchmedo to run commands when files change
	pip install watchmedo argcomplete

less-watch: $(WATCHMEDO_BIN)
	watchmedo shell-command --patterns=*.less --recursive --command="make less-compile" botbot/less

### Local JSHint

$(JSHINT_BIN): $(NPM_BIN)
	NPM_CONFIG_PREFIX=$(VIRTUAL_ENV) npm install jshint -g

jshint-install: $(JSHINT_BIN)

jshint:
	jshint botbot/static/js/app/

### Local Settings

.env:
	cp .env.example $@
<commit_msg>Fixes package name<commit_after># Developer Makefile

### Default Configuration.  Override in a make.config file

# the path to the lib folder in the venv
LOCAL_LIB=$(VIRTUAL_ENV)/lib

# where executables are stored
LOCAL_BIN=$(VIRTUAL_ENV)/bin

# where source files are stored
LOCAL_SRC=$(VIRTUAL_ENV)/src

NPM_BIN := $(or $(shell command -v npm),$(LOCAL_BIN)/npm)
LESS_BIN := $(or $(shell command -v lessc),$(LOCAL_BIN)/lessc)
JSHINT_BIN := $(or $(shell command -v jshint),$(LOCAL_BIN)/jshint)
WATCHMEDO_BIN := $(or $(shell command -v watchmedo),$(LOCAL_BIN)/watchmedo)

# allows a file make.config to override the above variables
-include make.config

### PIP
.pip-timestamp: requirements.txt
	pip install -r requirements.txt
	touch .pip-timestamp

pip-install: .pip-timestamp

$(LOCAL_BIN)/sphinx-build:
	pip install Sphinx

### GENERAL PYTHON COMMANDS
clean-pyc:
	find . -name '*.pyc' -exec rm -f {} +
	find . -name '*.pyo' -exec rm -f {} +
	find . -name '*~' -exec rm -f {} +

### GO SUPPORT

$(LOCAL_BIN)/botbot-bot:
	GOPATH=$(VIRTUAL_ENV) go get github.com/BotBotMe/botbot-bot

test-bot:
	GOPATH=$(VIRTUAL_ENV) go test github.com/BotBotMe/botbot-bot

$(LOCAL_BIN)/botbot-eventsource:
	GOPATH=$(VIRTUAL_ENV) go get github.com/BotBotMe/botbot-eventsource

### LOCAL LESS SUPPORT
$(NPM_BIN):
	@echo "Installing node.js..."
	cd $(VIRTUAL_ENV) && mkdir -p "src"
	cd $(LOCAL_LIB) && curl http://nodejs.org/dist/node-latest.tar.gz | tar xvz
	cd $(LOCAL_LIB)/node-v* && ./configure --prefix=$(VIRTUAL_ENV) && make install
	@echo "Installed npm"

$(LESS_BIN): $(NPM_BIN)
	NPM_CONFIG_PREFIX=$(VIRTUAL_ENV) npm install "less@<1.4" -g

less-install: $(LESS_BIN)

less-compile:
	lessc botbot/less/screen.less > botbot/static/css/screen.css

$(WATCHMEDO_BIN):
	# Install watchdog to run commands when files change
	pip install watchdog argcomplete

less-watch: $(WATCHMEDO_BIN)
	watchmedo shell-command --patterns=*.less --recursive --command="make less-compile" botbot/less

### Local JSHint

$(JSHINT_BIN): $(NPM_BIN)
	NPM_CONFIG_PREFIX=$(VIRTUAL_ENV) npm install jshint -g

jshint-install: $(JSHINT_BIN)

jshint:
	jshint botbot/static/js/app/

### Local Settings

.env:
	cp .env.example $@

{'fraction_non_alphanumeric': 0.15374056280027454, 'fraction_numerical': 0.0009151223976206818, 'mean_word_length': 4.555273189326557, 'pattern_counts': {'":': 0, '<': 5, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4677390', 'n_tokens_mistral': 1722, 'n_tokens_neox': 1649, 'n_words': 402}