Skip to content

Commit 9fbfae5

Browse files
committed
[dist test] Make linting against https://github.com/indexzero/styleguide the "pretest".
1 parent c5d7c82 commit 9fbfae5

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

lib/http-server.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,26 @@ var HTTPServer = exports.HTTPServer = function (options) {
3636
var serverOptions = {
3737
before: (options.before || []).concat([
3838
function (req, res) {
39-
options.logFn && options.logFn(req, res);
39+
if (options.logFn) {
40+
options.logFn(req, res);
41+
}
42+
4043
res.emit('next');
4144
},
4245
ecstatic({
4346
root: this.root,
4447
cache: this.cache,
45-
showDir : this.showDir,
48+
showDir: this.showDir,
4649
autoIndex: this.autoIndex,
4750
defaultExt: this.ext
4851
})
4952
]),
5053
headers: this.headers || {}
5154
};
5255

53-
if (options.https)
56+
if (options.https) {
5457
serverOptions.https = options.https;
58+
}
5559

5660
this.server = union.createServer(serverOptions);
5761
};

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
],
1515
"scripts": {
1616
"start": "node ./bin/http-server",
17+
"pretest": "stylezero bin/ lib/ test",
1718
"test": "vows --spec --isolate"
1819
},
1920
"contributors": [
@@ -63,7 +64,8 @@
6364
},
6465
"devDependencies": {
6566
"vows": "0.7.x",
66-
"request": "2.21.x"
67+
"request": "2.21.x",
68+
"stylezero": "2.1.1"
6769
},
6870
"bugs": {
6971
"url": "https://github.com/nodeapps/http-server/issues"

0 commit comments

Comments
 (0)