<commit_before>REPORTER = dot

TARGETS ?= unexpected.js unexpected.es5.js

lint:
	@./node_modules/.bin/jshint lib/*.js test/*.js

.PHONY: lint

unexpected.js: lint lib/*
	@echo "(function () {" > $@

	@cat lib/unexpected-license.js \
         lib/unexpected-namespace.js \
         lib/unexpected-es4-compatible.js \
         lib/unexpected-es5-compatible.js \
         lib/unexpected-utils.js \
         lib/unexpected-equal.js \
         lib/unexpected-inspect.js \
         lib/unexpected-core.js \
         lib/unexpected-assertions.js \
         lib/unexpected-module.js | sed -e 's/^/    /' | sed -e 's/^\s*$$//' | sed -e 's/\/\*\(global\|exported\).*//' >> $@

	@echo "}());" >> $@

unexpected.es5.js: lint lib/*
	@echo "(function () {" > $@

	@cat lib/unexpected-license.js \
         lib/unexpected-namespace.js \
         lib/unexpected-es5-compatible.js \
         lib/unexpected-utils.js \
         lib/unexpected-equal.js \
         lib/unexpected-inspect.js \
         lib/unexpected-core.js \
         lib/unexpected-assertions.js \
         lib/unexpected-module.js | sed -e 's/^/    /' | sed -e 's/^\s*$$//' | sed -e 's/\/\*\(global\|exported\).*//' >> $@

	@echo "}());" >> $@

test-phantomjs: lint
	@$(eval QUERY=$(shell node -e "console.log(decodeURIComponent(process.argv.pop()))" "${grep}")) \
    ./node_modules/.bin/mocha-phantomjs test/tests.html?grep=${QUERY}

test: lint
	mocha -R spec

.PHONY: test

test-production: lint ${TARGETS}
	@./node_modules/.bin/mocha-phantomjs test/tests.production.html
	@./node_modules/.bin/mocha-phantomjs test/tests.production.es5.html

.PHONY: test-production

lib-cov: lib/*
	@rm -rf lib-cov
	@jscoverage --no-highlight lib $@

lib-cov/index.html: lib-cov
	@COVERAGE=1 ./node_modules/.bin/mocha \
        --require ./test/common \
        --reporter html-cov > $@
	@echo Coverage report has been generated to $@

coverage: lib-cov/index.html

test-browser:
	@./node_modules/.bin/serve .

.PHONY: test-browser

git-dirty-check:
ifneq ($(shell git describe --always --dirty | grep -- -dirty),)
	$(error Working tree is dirty, please commit or stash your changes, then try again)
endif

.PHONY: git-dirty-check

.PHONY: git-commit-lib

.PHONY: release-%
release-%: git-dirty-check ${TARGETS} test-production
	npm version $*
	@echo $* release ready to be publised to NPM

.PHONY: clean
clean:
	-rm -fr ${TARGETS} lib-cov
<commit_msg>Makefile, release-% target: Remind user to push tags.<commit_after>REPORTER = dot

TARGETS ?= unexpected.js unexpected.es5.js

lint:
	@./node_modules/.bin/jshint lib/*.js test/*.js

.PHONY: lint

unexpected.js: lint lib/*
	@echo "(function () {" > $@

	@cat lib/unexpected-license.js \
         lib/unexpected-namespace.js \
         lib/unexpected-es4-compatible.js \
         lib/unexpected-es5-compatible.js \
         lib/unexpected-utils.js \
         lib/unexpected-equal.js \
         lib/unexpected-inspect.js \
         lib/unexpected-core.js \
         lib/unexpected-assertions.js \
         lib/unexpected-module.js | sed -e 's/^/    /' | sed -e 's/^\s*$$//' | sed -e 's/\/\*\(global\|exported\).*//' >> $@

	@echo "}());" >> $@

unexpected.es5.js: lint lib/*
	@echo "(function () {" > $@

	@cat lib/unexpected-license.js \
         lib/unexpected-namespace.js \
         lib/unexpected-es5-compatible.js \
         lib/unexpected-utils.js \
         lib/unexpected-equal.js \
         lib/unexpected-inspect.js \
         lib/unexpected-core.js \
         lib/unexpected-assertions.js \
         lib/unexpected-module.js | sed -e 's/^/    /' | sed -e 's/^\s*$$//' | sed -e 's/\/\*\(global\|exported\).*//' >> $@

	@echo "}());" >> $@

test-phantomjs: lint
	@$(eval QUERY=$(shell node -e "console.log(decodeURIComponent(process.argv.pop()))" "${grep}")) \
    ./node_modules/.bin/mocha-phantomjs test/tests.html?grep=${QUERY}

test: lint
	mocha -R spec

.PHONY: test

test-production: lint ${TARGETS}
	@./node_modules/.bin/mocha-phantomjs test/tests.production.html
	@./node_modules/.bin/mocha-phantomjs test/tests.production.es5.html

.PHONY: test-production

lib-cov: lib/*
	@rm -rf lib-cov
	@jscoverage --no-highlight lib $@

lib-cov/index.html: lib-cov
	@COVERAGE=1 ./node_modules/.bin/mocha \
        --require ./test/common \
        --reporter html-cov > $@
	@echo Coverage report has been generated to $@

coverage: lib-cov/index.html

test-browser:
	@./node_modules/.bin/serve .

.PHONY: test-browser

git-dirty-check:
ifneq ($(shell git describe --always --dirty | grep -- -dirty),)
	$(error Working tree is dirty, please commit or stash your changes, then try again)
endif

.PHONY: git-dirty-check

.PHONY: git-commit-lib

.PHONY: release-%
release-%: git-dirty-check ${TARGETS} test-production
	npm version $*
	@echo $* release ready to be publised to NPM
	@echo Remember to push tags

.PHONY: clean
clean:
	-rm -fr ${TARGETS} lib-cov

{'fraction_non_alphanumeric': 0.17859352443802845, 'fraction_numerical': 0.0028871932357187047, 'mean_word_length': 2.504335260115607, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 25, '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': '1603818', 'n_tokens_mistral': 1833, 'n_tokens_neox': 1772, 'n_words': 348}