diff --git a/.eslintrc b/.eslintrc index b43caae5c..2d7219f82 100644 --- a/.eslintrc +++ b/.eslintrc @@ -9,6 +9,10 @@ "single" ], "no-trailing-spaces": 2, + "comma-spacing": [ + "error", + { "before": false, "after": true } + ], "eqeqeq": [ "error", "always" diff --git a/bin/citgm-all.js b/bin/citgm-all.js index 9bd74b07a..4a577387a 100755 --- a/bin/citgm-all.js +++ b/bin/citgm-all.js @@ -78,7 +78,7 @@ if (!citgm.windows) { var uidnumber = require('uid-number'); var uid = app.uid || process.getuid(); var gid = app.gid || process.getgid(); - uidnumber(uid,gid, function(err, uid, gid) { + uidnumber(uid, gid, function(err, uid, gid) { options.uid = uid; options.gid = gid; launch(options); @@ -114,7 +114,7 @@ function runCitgm (mod, name, next) { log.info('starting', name); }).on('fail', function(err) { log.error('failure', err.message); - }).on('data', function(type,key,message) { + }).on('data', function(type, key, message) { log[type](key, message); }).on('end', function(result) { result.duration = new Date() - start; diff --git a/lib/citgm.js b/lib/citgm.js index 1755ceb05..03981a535 100644 --- a/lib/citgm.js +++ b/lib/citgm.js @@ -44,7 +44,7 @@ function find(app, context, next) { }); } -function init(context,next) { +function init(context, next) { // Script is passed as an option to citgm, but it needs to also apply to the // single module that citgm is testing. if (context.options.script) { @@ -57,7 +57,7 @@ function init(context,next) { context.emit('data', 'verbose', context.module.name + ' using-gid', context.options.gid); } context.emit('data', 'silly', context.module.name + ' init-detail', context.module); - next(null,context); // inject the context + next(null, context); // inject the context } function sha1(mod) { diff --git a/lib/lookup.js b/lib/lookup.js index 9e2fed8f4..d1c5c5fe5 100644 --- a/lib/lookup.js +++ b/lib/lookup.js @@ -24,8 +24,8 @@ function makeUrl(repo, spec, tags, prefix, sha) { // if necessary function getRepo(repo, meta) { var ret = normgit(repo || meta.repository.url).url; - ret = ret.replace(/\.git$/,''); - ret = ret.replace(/^git:/,'https:'); + ret = ret.replace(/\.git$/, ''); + ret = ret.replace(/^git:/, 'https:'); ret = ret.replace(/^ssh:\/\/git@/, 'https://'); return ret; } @@ -64,7 +64,7 @@ function resolve(context, next) { return; } var detail = context.module; - context.emit('data','info','lookup',detail.name); + context.emit('data', 'info', 'lookup', detail.name); var meta = context.meta; if (meta) { var rep = lookup[detail.name]; @@ -109,7 +109,7 @@ function resolve(context, next) { } } - next(null,context); + next(null, context); } module.exports = resolve; diff --git a/lib/match-conditions.js b/lib/match-conditions.js index 569fe5020..6e1f26cd3 100644 --- a/lib/match-conditions.js +++ b/lib/match-conditions.js @@ -29,7 +29,7 @@ if (fs.existsSync('/etc/os-release')) { release = execSync('sw_vers -productVersion').toString() || ''; } else if (platform === 'aix' ) { release = execSync('oslevel').toString() || ''; - release = release.replace(/(\r\n|\n|\r)/gm,'') || ''; + release = release.replace(/(\r\n|\n|\r)/gm, '') || ''; } var endian = process.config.variables.node_byteorder || ''; diff --git a/lib/npm/test.js b/lib/npm/test.js index 2b671af6a..caf5e223d 100644 --- a/lib/npm/test.js +++ b/lib/npm/test.js @@ -43,7 +43,7 @@ function test(context, next) { } var wd = path.join(context.path, context.module.name); context.emit('data', 'info', context.module.name + ' npm:', 'test suite started'); - readPackage(path.join(wd,'package.json'),false,function(err,data) { + readPackage(path.join(wd, 'package.json'), false, function(err, data) { if (err) { next(new Error('Package.json Could not be found')); return; diff --git a/lib/out.js b/lib/out.js index b37352d0a..450d0fd3c 100644 --- a/lib/out.js +++ b/lib/out.js @@ -13,11 +13,11 @@ logger.add(logger.transports.Console, { function output(tag, message, dest) { var obj; if (typeof message === 'object') { - obj = JSON.stringify(message,null,2); + obj = JSON.stringify(message, null, 2); message = ''; } var msg = columnify( - [{tag:tag,message:message}], + [{tag:tag, message:message}], { showHeaders: false, maxLineWidth: 'auto', diff --git a/lib/unpack.js b/lib/unpack.js index 1517bc402..7919c7430 100644 --- a/lib/unpack.js +++ b/lib/unpack.js @@ -14,7 +14,7 @@ function unpack(context, next) { var gzip = zlib.createGunzip(); var inp = fs.createReadStream(context.unpack); var out = tar.Extract({ - path: path.join(context.path,context.module.name), + path: path.join(context.path, context.module.name), strip: 1 }); var res = inp.pipe(gzip).pipe(out);