2017-03-12 07:34:36 +00:00
|
|
|
SHELL=/bin/bash
|
|
|
|
LIB=ssf
|
|
|
|
CMDS=bin/ssf.njs
|
|
|
|
HTMLLINT=
|
|
|
|
|
|
|
|
ULIB=$(shell echo $(LIB) | tr a-z A-Z)
|
|
|
|
TARGET=$(LIB).js
|
|
|
|
|
|
|
|
## Main Targets
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: ssf
|
2013-12-14 03:28:57 +00:00
|
|
|
ssf: ssf.md
|
|
|
|
voc ssf.md
|
|
|
|
|
2017-03-12 07:34:36 +00:00
|
|
|
## Testing
|
|
|
|
|
|
|
|
.PHONY: test mocha
|
|
|
|
test mocha: ## Run test suite
|
2013-12-14 03:28:57 +00:00
|
|
|
npm test
|
2014-01-20 08:37:48 +00:00
|
|
|
|
2014-02-11 19:20:34 +00:00
|
|
|
test_min:
|
|
|
|
MINTEST=1 npm test
|
|
|
|
|
2017-03-12 07:34:36 +00:00
|
|
|
## Code Checking
|
|
|
|
|
2014-01-20 08:37:48 +00:00
|
|
|
.PHONY: lint
|
2017-03-12 07:34:36 +00:00
|
|
|
lint: ## Run jshint and jscs checks
|
|
|
|
@jshint --show-non-errors $(TARGET) test/
|
|
|
|
@jshint --show-non-errors $(CMDS)
|
|
|
|
@jshint --show-non-errors package.json
|
|
|
|
@jshint --show-non-errors --extract=always $(HTMLLINT)
|
|
|
|
@jscs $(TARGET)
|
2014-01-20 08:37:48 +00:00
|
|
|
|
2017-03-12 07:34:36 +00:00
|
|
|
.PHONY: flow
|
|
|
|
flow: lint ## Run flow checker
|
|
|
|
@flow check --all --show-all-errors
|
2014-06-13 15:02:06 +00:00
|
|
|
|
2014-01-20 08:37:48 +00:00
|
|
|
.PHONY: cov
|
2017-03-12 07:34:36 +00:00
|
|
|
cov: tmp/coverage.html ## Run coverage test
|
2014-01-20 08:37:48 +00:00
|
|
|
|
2014-02-11 19:20:34 +00:00
|
|
|
.PHONY: cov_min
|
|
|
|
cov_min:
|
|
|
|
MINTEST=1 make cov
|
|
|
|
|
2017-03-12 07:34:36 +00:00
|
|
|
tmp/coverage.html: ssf
|
|
|
|
mocha --require blanket -R html-cov -t 20000 > $@
|
|
|
|
|
|
|
|
.PHONY: full_coveralls
|
2014-03-27 21:31:10 +00:00
|
|
|
full_coveralls:
|
2014-01-20 08:37:48 +00:00
|
|
|
mocha --require blanket --reporter mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js
|
2014-03-27 21:31:10 +00:00
|
|
|
|
2017-03-12 07:34:36 +00:00
|
|
|
.PHONY: coveralls
|
|
|
|
coveralls: ## Coverage Test + Send to coveralls.io
|
2014-03-27 21:31:10 +00:00
|
|
|
MINTEST=1 make full_coveralls
|
2017-03-12 07:34:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
.PHONY: help
|
|
|
|
help:
|
|
|
|
@grep -hE '(^[a-zA-Z_-][ a-zA-Z_-]*:.*?|^#[#*])' $(MAKEFILE_LIST) | bash misc/help.sh
|
|
|
|
|
|
|
|
#* To show a spinner, append "-spin" to any target e.g. cov-spin
|
|
|
|
%-spin:
|
|
|
|
@make $* & bash misc/spin.sh $$!
|