Skip to content

Commit

Permalink
Stricter JSHint, 'make ci' task
Browse files Browse the repository at this point in the history
  • Loading branch information
stewart committed Jan 5, 2015
1 parent 19bda1a commit 6ace54c
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 31 deletions.
47 changes: 28 additions & 19 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
{
"node": true,

"globals": {
"every": true,
"after": true,
"constantly": true,

"it": true,
"expect": true,
"source": true,
"describe": true,
"context": true,
"beforeEach": true,
"afterEach": true,
"stub": true,
"spy": true,
"chai": true,
"sinon": true
},

"boss": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"immed": true,
"indent": 2,
"latedef": true,
"maxlen": 80,
"newcap": true,
"noarg": true,
"nonew": true,
"quotmark": "double",
"strict": true,
"sub": true,
"undef": true,
"unused": true,
"boss": true,
"eqnull": true,
"node": true,
"predef": [
"Cylon",
"Logger",

"after",
"bind",
"constantly",
"every",
"hasProp",
"proxyFunctionsToObject",
"proxyTestStubs",
"sleep",
"slice",
"subclass"
]
"unused": true
}
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ node_js:
install:
- npm install
- npm install git://github.com/hybridgroup/cylon.git
- npm install -g istanbul codeclimate-test-reporter
- npm install -g jshint istanbul codeclimate-test-reporter
script:
- make cover
- make ci
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
BIN := ./node_modules/.bin
FILES := $(shell find lib spec/lib examples -type f -name "*.js")
TEST_FILES := spec/helper.js $(shell find spec/lib -type f -name "*.js")

VERSION := $(shell node -e "console.log(require('./package.json').version)")

# Our 'phony' make targets (don't involve any file changes)
.PHONY: test bdd lint release
.PHONY: default cover test bdd lint ci release

default: lint test

# Run Mocha, with standard reporter.
test:
@$(BIN)/mocha -r cylon --colors $(TEST_FILES)
@$(BIN)/mocha --colors -R dot $(TEST_FILES)

# Run Mocha, with more verbose BDD reporter.
bdd:
@$(BIN)/mocha -r cylon --colors -R spec $(TEST_FILES)
@$(BIN)/mocha --colors -R spec $(TEST_FILES)

cover:
@istanbul cover $(BIN)/_mocha $(TEST_FILES) --report lcovonly -- -R spec

# Run JSHint
lint:
@$(BIN)/jshint ./lib
@jshint $(FILES)

ci: lint cover

# Cuts/publishes a new release
release:
release: lint test
@git push origin master
@git checkout release ; git merge master ; git push ; git checkout master
@git tag -m "$(VERSION)" v$(VERSION)
Expand Down

0 comments on commit 6ace54c

Please sign in to comment.