1 | BIN=bin/jslint.js
|
2 | SOURCES=$(shell find bin lib -name '*.js' ! -name 'jslint*.js' -print)
|
3 |
|
4 | install:
|
5 | npm i .
|
6 |
|
7 | # omit 'test' because running all tests is side-effect of asking for coverage
|
8 | prepublish: lint doc no-dos-endings check-coverage
|
9 |
|
10 | lint: $(SOURCES)
|
11 | node ./bin/jslint.js --terse $(SOURCES); echo
|
12 |
|
13 | test:
|
14 | ./node_modules/.bin/mocha -u tdd
|
15 |
|
16 | doc: man/jslint.1 doc/jslint.html
|
17 |
|
18 | man/jslint.1: doc/jslint.md
|
19 | mkdir -p man
|
20 | ./node_modules/.bin/ronn -r $< > $@
|
21 |
|
22 | doc/jslint.html: doc/jslint.md
|
23 | ./node_modules/.bin/ronn -5 $< > $@
|
24 |
|
25 | no-dos-endings:
|
26 | file $(SOURCES) | grep -v CRLF >/dev/null
|
27 |
|
28 | cover: $(SOURCES)
|
29 | ./node_modules/.bin/istanbul cover -x "lib/jslint-*.js" --print=both ./node_modules/mocha/bin/_mocha -- -u tdd
|
30 |
|
31 | check-coverage: cover
|
32 | ./node_modules/.bin/istanbul check-coverage --statements 90 --branches 90 --functions 90 --lines 90
|
33 |
|
34 | .PHONY: install lint test doc no-dos-endings check-coverage
|