Skip to content

Commit

Permalink
Merge pull request #129 from sanctuary-js/davidchambers/lint
Browse files Browse the repository at this point in the history
lint: use a Markdown parser to check link definitions
  • Loading branch information
davidchambers authored Mar 29, 2017
2 parents d278caa + 21fcc84 commit d15607b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ESLINT = node_modules/.bin/eslint --config node_modules/sanctuary-style/eslint-es3.json --env es3
ISTANBUL = node_modules/.bin/istanbul
NPM = npm
REMARK = node_modules/.bin/remark --frail --no-stdout
REMEMBER_BOWER = node_modules/.bin/remember-bower
TRANSCRIBE = node_modules/.bin/transcribe
XYZ = node_modules/.bin/xyz --repo [email protected]:sanctuary-js/sanctuary-def.git --script scripts/prepublish
Expand Down Expand Up @@ -39,12 +40,13 @@ lint:
--rule 'max-len: [off]' \
-- test
$(REMEMBER_BOWER) $(shell pwd)
@echo 'Checking for missing link definitions...'
grep '^[ ]*//[.]' index.js \
| grep -o '\[[^]]*\]\[[^]]*\]' \
| sed -n -e 's:\[\(.*\)\]\[\]:\1:p' -e 's:\[.*\]\[\(.*\)\]:\1:p' \
| sort -u \
| xargs -I '{}' sh -c "grep '^//[.] \[{}\]: ' index.js"
rm -f README.md
VERSION=0.0.0 make README.md
$(REMARK) \
--use remark-lint-no-undefined-references \
--use remark-lint-no-unused-definitions \
-- README.md
git checkout README.md


.PHONY: release-major release-minor release-patch
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"eslint": "2.9.x",
"istanbul": "0.4.x",
"mocha": "3.x.x",
"remark-cli": "3.x.x",
"remark-lint-no-undefined-references": "1.x.x",
"remark-lint-no-unused-definitions": "1.x.x",
"remember-bower": "0.1.x",
"sanctuary-style": "0.4.x",
"transcribe": "0.5.x",
Expand Down

0 comments on commit d15607b

Please sign in to comment.