From 62ecf0b052db29d15d01bc5f728a71233fcf4375 Mon Sep 17 00:00:00 2001 From: Francois Marier Date: Wed, 30 Apr 2014 19:17:06 +1200 Subject: [PATCH] Add a Makefile to make it easy to run the linter --- CONTRIBUTING.md | 8 ++++++-- Makefile | 10 ++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 Makefile diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 10c770c..194ff5a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,9 +8,13 @@ This contributors document should be the canonical place for answers to: # Before submitting a pull request -To install jshint, simply `npm install jshint` from the root directory of the project. Then run like it like this: +You can run the test suite like this: - node_modules/.bin/jshint data/*.js + make test + +In addition to running the tests, you should lint the code. To install jshint, simply `npm install jshint` from the root directory of the project. Then run like it like this: + + make lint and make sure your changes are not adding any new warnings or errors. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..bae4ff8 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +all: + +lint: + @test -x node_modules/.bin/jshint || (echo "You must install jshint first: npm install jshint" && exit 1) + @node_modules/.bin/jshint data/*.js lib/*.js lib/*/*.js javascripts/*.js + +test: + cfx test + +.PHONY: lint test