<commit_before># language specific config (you can tweak per language)
ASSIGNMENT ?= ""
FILEEXT := "js"
PATTERN := "$(ASSIGNMENT)_test.spec.$(FILEEXT)"

# output directory
TMPDIR ?= "/tmp"
OUTDIR := $(shell mktemp -d "$(TMPDIR)/$(ASSIGNMENT).XXXXXXXXXX")

# assignments
ASSIGNMENTS = $(shell find . -maxdepth 1 -mindepth 1 -type d | tr -d './' | grep -v 'node_modules')

test-assignment: node_modules
	@echo "running tests for: $(ASSIGNMENT)"
	@cp $(ASSIGNMENT)/$(PATTERN) $(OUTDIR)
	@cp $(ASSIGNMENT)/example.js $(OUTDIR)/$(ASSIGNMENT).$(FILEEXT)
	@./node_modules/.bin/jasmine-node --captureExceptions $(OUTDIR)/$(PATTERN)

test:
	@for assignment in $(ASSIGNMENTS); do ASSIGNMENT=$$assignment $(MAKE) test-assignment || exit 1; done

node_modules: package.json
	@npm prune
	@npm install
<commit_msg>- sort ASSIGNMENTS list so tests run in alpha order - force make to quietly change directories (for CI output)<commit_after># language specific config (you can tweak per language)
ASSIGNMENT ?= ""
FILEEXT := "js"
PATTERN := "$(ASSIGNMENT)_test.spec.$(FILEEXT)"

# output directory
TMPDIR ?= "/tmp"
OUTDIR := $(shell mktemp -d "$(TMPDIR)/$(ASSIGNMENT).XXXXXXXXXX")

# assignments
ASSIGNMENTS = $(shell find . -maxdepth 1 -mindepth 1 -type d | tr -d './' | grep -v 'node_modules' | sort)

test-assignment: node_modules
	@echo "running tests for: $(ASSIGNMENT)"
	@cp $(ASSIGNMENT)/$(PATTERN) $(OUTDIR)
	@cp $(ASSIGNMENT)/example.js $(OUTDIR)/$(ASSIGNMENT).$(FILEEXT)
	@./node_modules/.bin/jasmine-node --captureExceptions $(OUTDIR)/$(PATTERN)

test:
	@for assignment in $(ASSIGNMENTS); do ASSIGNMENT=$$assignment $(MAKE) -s test-assignment || exit 1; done

node_modules: package.json
	@npm prune
	@npm install

{'fraction_non_alphanumeric': 0.1675454012888108, 'fraction_numerical': 0.0035149384885764497, 'mean_word_length': 5.014084507042254, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '4915020', 'n_tokens_mistral': 612, 'n_tokens_neox': 578, 'n_words': 164}