<commit_before>JSDOC3=~/src/git-repos/jsdoc/jsdoc

all: build

# This is admitedly primitive and wasteful. Settling on a better build
# method is part of the TODO.
.PHONY: build
build:
	-rm -rf build
	mkdir build
	ls lib/salve/*.js | grep -v parse.js | xargs -n1 -iXX cp --parents -rp XX build

.PHONY: test
test: build
	semver-sync -v
	mocha

doc:
	$(JSDOC3) -d build/doc -r lib<commit_msg>Now use local.mk for local settings. Revamp of build process. More targets.<commit_after>-include local.mk

JSDOC3?=jsdoc
RST2HTML=rst2html

all: build

LIB_FILES:=$(shell find lib -type f -not -name "*_flymake.*" -not -path "lib/salve/parse.js")
BUILD_LIB_FILES:=$(foreach f,$(LIB_FILES),build/$f)

.PHONY: build-dir
build-dir: 
	-@[ -e build ] || mkdir build

.PHONY: build
build: $(BUILD_LIB_FILES) | build-dir

build/lib/%: lib/%
	-@[ -e $(dir $@) ] || mkdir -p $(dir $@)
	cp $< $@

.PHONY: test
test: build
	semver-sync -v
	mocha

.PHONY: doc
doc:
	$(JSDOC3) -d build/doc -r lib
# rst2html does not seem to support rewriting relative
# urls. So we produce the html in our root.
	$(RST2HTML) README.rst README.html

.PHONY: clean
clean:
	-rm -rf build
	-rm README.html
{'fraction_non_alphanumeric': 0.14445399828030955, 'fraction_numerical': 0.007738607050730868, 'mean_word_length': 3.425855513307985, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, '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': '6373614', 'n_tokens_mistral': 489, 'n_tokens_neox': 471, 'n_words': 146}