Skip to content

Commit

Permalink
style: add jshint and fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
popomore committed Jan 14, 2015
1 parent cad396d commit 2e4af48
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
coverage
test/fixtures
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
test:
jshint:
@node_modules/.bin/jshint .

test: jshint
@node --harmony \
node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha \
-- \
Expand Down
2 changes: 1 addition & 1 deletion lib/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function getPackageWithTag(body, args) {
function getPackage(body, args) {
if (!body.packages) return body;
if (args.version) {
debug('get package version %s', version);
debug('get package version %s', args.version);
return body.packages[args.version];
} else {
return body;
Expand Down
10 changes: 6 additions & 4 deletions lib/tar.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

// Thanks to npm.
var fstream = require('fstream');
var tar = require('tar');
Expand Down Expand Up @@ -89,7 +91,7 @@ function Packer(props) {
// in a user-writable state, even if they're
// being installed from some wackey vm-mounted
// read-only filesystem.
entry.mode = props.mode = props.mode | 0200;
entry.mode = props.mode = props.mode | parseInt('0200', 8);
});
}

Expand Down Expand Up @@ -121,11 +123,11 @@ Packer.prototype.applyIgnores = function(entry, partial, entryObj) {
};

Packer.prototype.addIgnoreFiles = function () {
var entries = this.entries
var entries = this.entries;
// if there's a .spmignore, then we do *not* want to
// read the .gitignore.
if (-1 !== entries.indexOf(".spmignore")) {
var i = entries.indexOf(".gitignore")
if (-1 !== entries.indexOf('.spmignore')) {
var i = entries.indexOf('.gitignore');
if (i !== -1) {
entries.splice(i, 1);
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"mocha": "1",
"rimraf": "2",
"should": "4",
"spy": "~0.1.0"
"spy": "~0.1.0",
"jshint": "*"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion test/tar.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ describe('tar', function() {
});
});
});
})
});

0 comments on commit 2e4af48

Please sign in to comment.