jenkins-bot has submitted this change and it was merged.
Change subject: Use updated jscs and wikimedia preset
..
Use updated jscs and wikimedia preset
Change-Id: I77c150d08ac339a78d2b713a372594e8b2dd38c2
---
M .jscsrc
M Gruntfile.js
M Server.js
M dictionary/dict/DictClient.js
M lineardoc/LinearDoc.js
M package.json
6 files changed, 12 insertions(+), 44 deletions(-)
Approvals:
Divec: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.jscsrc b/.jscsrc
index 8d8d0f7..9d22e3f 100644
--- a/.jscsrc
+++ b/.jscsrc
@@ -1,35 +1,3 @@
{
- requireCurlyBraces: [if, else, for, while, do, try,
catch],
- requireSpaceAfterKeywords: [if, else, for, while, do,
switch, return, try, catch, function],
- requireParenthesesAroundIIFE: true,
- disallowSpacesInNamedFunctionExpression: {
- beforeOpeningRoundBrace: true
- },
- disallowSpacesInFunctionDeclaration: {
- beforeOpeningRoundBrace: true
- },
- requireMultipleVarDecl: true,
- disallowEmptyBlocks: true,
- requireSpacesInsideObjectBrackets: all,
- disallowQuotedKeysInObjects: true,
- disallowDanglingUnderscores: true,
- disallowSpaceAfterObjectKeys: true,
- disallowSpaceAfterPrefixUnaryOperators: [++, --, +, -, ~,
!],
- disallowSpaceBeforePostfixUnaryOperators: [++, --],
- disallowSpaceBeforeBinaryOperators: [,],
- requireSpaceBeforeBinaryOperators: [=, +, -, /, *, ==,
===, !=, !==, , =, , =],
- requireSpaceAfterBinaryOperators: [=, +, -, /, *, ==,
===, !=, !==, , =, , =],
- requireCamelCaseOrUpperCaseIdentifiers: true,
- disallowKeywords: [ with ],
- disallowMultipleLineBreaks: true,
- validateLineBreaks: LF,
- validateQuoteMarks: ',
- disallowMixedSpacesAndTabs: true,
- disallowTrailingWhitespace: true,
- disallowTrailingComma: true,
- disallowKeywordsOnNewLine: [else],
- requireLineFeedAtFileEnd: true,
- requireCapitalizedConstructors: true,
- requireDotNotation: true,
- disallowYodaConditions: true
+ preset: wikimedia
}
diff --git a/Gruntfile.js b/Gruntfile.js
index 71ed8ab..239832b 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -9,7 +9,7 @@
options: {
jshintrc: true
},
- all: ['*.js',
'{models,mt,pageloader,public,segmentation,tests}/**/*.js']
+ all: [ '*.js',
'{models,mt,pageloader,public,segmentation,tests}/**/*.js' ]
},
jscs: {
src: '%= jshint.all %'
@@ -19,10 +19,10 @@
'.{jscsrc,jshintignore,jshintrc}',
'%= jshint.all %'
],
- tasks: ['test']
+ tasks: [ 'test' ]
}
} );
- grunt.registerTask( 'test', ['jshint', 'jscs'] );
+ grunt.registerTask( 'test', [ 'jshint', 'jscs' ] );
grunt.registerTask( 'default', 'test' );
};
diff --git a/Server.js b/Server.js
index 3e715b5..40a9cb5 100755
--- a/Server.js
+++ b/Server.js
@@ -1,4 +1,3 @@
-#!/usr/bin/env node
/**
* A very basic cluster-based server runner. Restarts failed workers.
*
@@ -8,15 +7,16 @@
'use strict';
var cluster = require( 'cluster' ),
- logger = require( __dirname + '/utils/Logger.js' );
+ logger = require( __dirname + '/utils/Logger.js' ),
+ numCPUs, i;
if ( cluster.isMaster ) {
// Start a few more workers than there are cpus visible to the OS, so
that we
// get some degree of parallelism even on single-core systems. A single
// long-running request would otherwise hold up all concurrent short
requests.
- var numCPUs = require( 'os' ).cpus().length + 3;
+ numCPUs = require( 'os' ).cpus().length + 3;
// Fork workers.
- for ( var i = 0; i numCPUs; i++ ) {
+ for ( i = 0; i numCPUs; i++ ) {
cluster.fork();
}
diff --git a/dictionary/dict/DictClient.js b/dictionary/dict/DictClient.js
index 38dee85..310401f 100644
--- a/dictionary/dict/DictClient.js
+++ b/dictionary/dict/DictClient.js
@@ -473,7 +473,7 @@
word: word,
//type: type,
db: options.db || config.db
- } ];
+ } ];
break;
case 'multi':
diff --git a/lineardoc/LinearDoc.js b/lineardoc/LinearDoc.js
index 1dd5f39..d14bcf5 100644
--- a/lineardoc/LinearDoc.js
+++ b/lineardoc/LinearDoc.js
@@ -229,7 +229,7 @@
while ( boundaries[boundaryPtr] === 0 ) {
boundaryPtr++;
}
- for( i = 0, len = chunks.length; i len; i++ ) {
+ for ( i = 0, len = chunks.length; i len; i++ ) {
groupBoundaries = [];