From: James D. Forrester Date: Fri, 18 Jul 2014 20:22:57 +0000 (-0700) Subject: build: Update grunt-jscs (formerly grunt-jscs-checker) from 0.4.4 to 0.6.1 X-Git-Tag: 1.31.0-rc.0~14885 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=f668c1d9e21ca5cdd174fa16c94117bd78a5a623;p=lhc%2Fweb%2Fwiklou.git build: Update grunt-jscs (formerly grunt-jscs-checker) from 0.4.4 to 0.6.1 Also switch to the new 'wikimedia' preset in jscs to make .jscsrc shorter (but with a number of exemptions that need to be cleaned up later). Change-Id: I836f3e96f2126f3684c3e60b7fa11de8724b5262 --- diff --git a/.jscsrc b/.jscsrc index 0da9aa5a24..b9139b2fad 100644 --- a/.jscsrc +++ b/.jscsrc @@ -1,94 +1,10 @@ { - "requireCurlyBraces": [ - "if", - "else", - "for", - "while", - "do", - "try", - "catch" - ], - "requireSpaceAfterKeywords": [ - "if", - "else", - "for", - "while", - "do", - "switch", - "return", - "try", - "catch", - "function" - ], - "requireSpaceBeforeBlockStatements": true, - "requireParenthesesAroundIIFE": true, - "requireSpacesInConditionalExpression": true, - "disallowSpacesInNamedFunctionExpression": { - "beforeOpeningRoundBrace": true - }, - "disallowSpacesInFunctionDeclaration": { - "beforeOpeningRoundBrace": true - }, - "requireMultipleVarDecl": "onevar", - "requireBlocksOnNewline": 1, - "disallowEmptyBlocks": true, - "requireSpacesInsideObjectBrackets": "all", - "disallowSpaceAfterObjectKeys": true, - "requireCommaBeforeLineBreak": true, - "disallowSpaceAfterPrefixUnaryOperators": [ - "++", - "--", - "+", - "-", - "~", - "!" - ], - "disallowSpaceBeforePostfixUnaryOperators": [ - "++", - "--" - ], - "disallowSpaceBeforeBinaryOperators": [ - "," - ], - "requireSpaceBeforeBinaryOperators": [ - "=", - "+", - "-", - "/", - "*", - "==", - "===", - "!=", - "!==", - ">", - ">=", - "<", - "<=" - ], - "requireSpaceAfterBinaryOperators": [ - "=", - "+", - "-", - "/", - "*", - "==", - "===", - "!=", - "!==", - ">", - ">=", - "<", - "<=" - ], - "disallowKeywords": [ "with" ], - "disallowMultipleLineBreaks": true, - "validateLineBreaks": "LF", - "validateQuoteMarks": "'", - "disallowMixedSpacesAndTabs": true, - "disallowTrailingWhitespace": true, - "disallowTrailingComma": true, - "requireLineFeedAtFileEnd": true, - "requireCapitalizedConstructors": true, - "requireDotNotation": true, - "disallowYodaConditions": true + "preset": "wikimedia", + + "disallowDanglingUnderscores": null, + "disallowKeywordsOnNewLine": null, + "disallowQuotedKeysInObjects": null, + "requireCamelCaseOrUpperCaseIdentifiers": null, + "requireSpacesInsideArrayBrackets": null, + "validateIndentation": null } diff --git a/resources/src/jquery/jquery.colorUtil.js b/resources/src/jquery/jquery.colorUtil.js index be770a95e2..a6ff8bc8bc 100644 --- a/resources/src/jquery/jquery.colorUtil.js +++ b/resources/src/jquery/jquery.colorUtil.js @@ -33,22 +33,38 @@ // Look for rgb(num,num,num) if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) { - return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)]; + return [ + parseInt( result[1], 10 ), + parseInt( result[2], 10 ), + parseInt( result[3], 10 ) + ]; } // Look for rgb(num%,num%,num%) if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) { - return [parseFloat(result[1],10) * 2.55, parseFloat(result[2],10) * 2.55, parseFloat(result[3]) * 2.55]; + return [ + parseFloat( result[1] ) * 2.55, + parseFloat( result[2] ) * 2.55, + parseFloat( result[3] ) * 2.55 + ]; } // Look for #a0b1c2 if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) { - return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)]; + return [ + parseInt( result[1], 16 ), + parseInt( result[2], 16 ), + parseInt( result[3], 16 ) + ]; } // Look for #fff if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) { - return [parseInt(result[1] + result[1],16), parseInt(result[2] + result[2],16), parseInt(result[3] + result[3],16)]; + return [ + parseInt( result[1] + result[1], 16 ), + parseInt( result[2] + result[2], 16 ), + parseInt( result[3] + result[3], 16) + ]; } // Look for rgba(0, 0, 0, 0) == transparent in Safari 3 @@ -69,50 +85,50 @@ * @property {Object} */ colors: { - aqua: [0,255,255], - azure: [240,255,255], - beige: [245,245,220], - black: [0,0,0], - blue: [0,0,255], - brown: [165,42,42], - cyan: [0,255,255], - darkblue: [0,0,139], - darkcyan: [0,139,139], - darkgrey: [169,169,169], - darkgreen: [0,100,0], - darkkhaki: [189,183,107], - darkmagenta: [139,0,139], - darkolivegreen: [85,107,47], - darkorange: [255,140,0], - darkorchid: [153,50,204], - darkred: [139,0,0], - darksalmon: [233,150,122], - darkviolet: [148,0,211], - fuchsia: [255,0,255], - gold: [255,215,0], - green: [0,128,0], - indigo: [75,0,130], - khaki: [240,230,140], - lightblue: [173,216,230], - lightcyan: [224,255,255], - lightgreen: [144,238,144], - lightgrey: [211,211,211], - lightpink: [255,182,193], - lightyellow: [255,255,224], - lime: [0,255,0], - magenta: [255,0,255], - maroon: [128,0,0], - navy: [0,0,128], - olive: [128,128,0], - orange: [255,165,0], - pink: [255,192,203], - purple: [128,0,128], - violet: [128,0,128], - red: [255,0,0], - silver: [192,192,192], - white: [255,255,255], - yellow: [255,255,0], - transparent: [255,255,255] + aqua: [0, 255, 255], + azure: [240, 255, 255], + beige: [245, 245, 220], + black: [0, 0, 0], + blue: [0, 0, 255], + brown: [165, 42, 42], + cyan: [0, 255, 255], + darkblue: [0, 0, 139], + darkcyan: [0, 139, 139], + darkgrey: [169, 169, 169], + darkgreen: [0, 100, 0], + darkkhaki: [189, 183, 107], + darkmagenta: [139, 0, 139], + darkolivegreen: [85, 107, 47], + darkorange: [255, 140, 0], + darkorchid: [153, 50, 204], + darkred: [139, 0, 0], + darksalmon: [233, 150, 122], + darkviolet: [148, 0, 211], + fuchsia: [255, 0, 255], + gold: [255, 215, 0], + green: [0, 128, 0], + indigo: [75, 0, 130], + khaki: [240, 230, 140], + lightblue: [173, 216, 230], + lightcyan: [224, 255, 255], + lightgreen: [144, 238, 144], + lightgrey: [211, 211, 211], + lightpink: [255, 182, 193], + lightyellow: [255, 255, 224], + lime: [0, 255, 0], + magenta: [255, 0, 255], + maroon: [128, 0, 0], + navy: [0, 0, 128], + olive: [128, 128, 0], + orange: [255, 165, 0], + pink: [255, 192, 203], + purple: [128, 0, 128], + violet: [128, 0, 128], + red: [255, 0, 0], + silver: [192, 192, 192], + white: [255, 255, 255], + yellow: [255, 255, 0], + transparent: [255, 255, 255] }, /** diff --git a/resources/src/mediawiki.language/languages/la.js b/resources/src/mediawiki.language/languages/la.js index 04b7d0a22b..52e8dd4429 100644 --- a/resources/src/mediawiki.language/languages/la.js +++ b/resources/src/mediawiki.language/languages/la.js @@ -14,9 +14,9 @@ mediaWiki.language.convertGrammar = function ( word, form ) { word = word.replace( /u[ms]$/i, 'i' ); // 2nd declension singular word = word.replace( /ommunia$/i, 'ommunium' ); // 3rd declension neuter plural (partly) word = word.replace( /a$/i, 'ae' ); // 1st declension singular - word = word.replace( /libri$/i,'librorum' ); // 2nd declension plural (partly) + word = word.replace( /libri$/i, 'librorum' ); // 2nd declension plural (partly) word = word.replace( /nuntii$/i, 'nuntiorum' ); // 2nd declension plural (partly) - word = word.replace( /tio$/i,'tionis' ); // 3rd declension singular (partly) + word = word.replace( /tio$/i, 'tionis' ); // 3rd declension singular (partly) word = word.replace( /ns$/i, 'ntis' ); word = word.replace( /as$/i, 'atis' ); word = word.replace( /es$/i, 'ei' ); // 5th declension singular @@ -26,9 +26,9 @@ mediaWiki.language.convertGrammar = function ( word, form ) { word = word.replace( /u[ms]$/i, 'um' ); // 2nd declension singular word = word.replace( /ommunia$/i, 'am' ); // 3rd declension neuter plural (partly) word = word.replace( /a$/i, 'ommunia' ); // 1st declension singular - word = word.replace( /libri$/i,'libros' ); // 2nd declension plural (partly) + word = word.replace( /libri$/i, 'libros' ); // 2nd declension plural (partly) word = word.replace( /nuntii$/i, 'nuntios' );// 2nd declension plural (partly) - word = word.replace( /tio$/i,'tionem' ); // 3rd declension singular (partly) + word = word.replace( /tio$/i, 'tionem' ); // 3rd declension singular (partly) word = word.replace( /ns$/i, 'ntem' ); word = word.replace( /as$/i, 'atem'); word = word.replace( /es$/i, 'em' ); // 5th declension singular @@ -38,9 +38,9 @@ mediaWiki.language.convertGrammar = function ( word, form ) { word = word.replace( /u[ms]$/i, 'o' ); // 2nd declension singular word = word.replace( /ommunia$/i, 'ommunibus' ); // 3rd declension neuter plural (partly) word = word.replace( /a$/i, 'a' ); // 1st declension singular - word = word.replace( /libri$/i,'libris' ); // 2nd declension plural (partly) + word = word.replace( /libri$/i, 'libris' ); // 2nd declension plural (partly) word = word.replace( /nuntii$/i, 'nuntiis' ); // 2nd declension plural (partly) - word = word.replace( /tio$/i,'tione' ); // 3rd declension singular (partly) + word = word.replace( /tio$/i, 'tione' ); // 3rd declension singular (partly) word = word.replace( /ns$/i, 'nte' ); word = word.replace( /as$/i, 'ate'); word = word.replace( /es$/i, 'e' ); // 5th declension singular diff --git a/tests/frontend/Gruntfile.js b/tests/frontend/Gruntfile.js index 69fda8d11f..59c18a8a1b 100644 --- a/tests/frontend/Gruntfile.js +++ b/tests/frontend/Gruntfile.js @@ -7,7 +7,7 @@ module.exports = function ( grunt ) { grunt.loadNpmTasks( 'grunt-contrib-jshint' ); grunt.loadNpmTasks( 'grunt-contrib-watch' ); grunt.loadNpmTasks( 'grunt-banana-checker' ); - grunt.loadNpmTasks( 'grunt-jscs-checker' ); + grunt.loadNpmTasks( 'grunt-jscs' ); grunt.loadNpmTasks( 'grunt-jsonlint' ); grunt.file.setBase( __dirname + '/../..' ); diff --git a/tests/frontend/package.json b/tests/frontend/package.json index a398596e35..386f4880a7 100644 --- a/tests/frontend/package.json +++ b/tests/frontend/package.json @@ -9,7 +9,7 @@ "grunt-contrib-jshint": "0.10.0", "grunt-contrib-watch": "0.6.1", "grunt-banana-checker": "0.1.0", - "grunt-jscs-checker": "0.4.4", + "grunt-jscs": "0.6.1", "grunt-jsonlint": "1.0.4" } }