Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/225040
Change subject: Update farmer tests ...................................................................... Update farmer tests Change-Id: I04388820caced6f79ec2110d2fc3e9ef5c88ffa3 --- A .jscsrc A .jshintignore A .jshintrc D Farmer.i18n.php M Farmer.php A Gruntfile.js A composer.json A package.json 8 files changed, 85 insertions(+), 36 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Farmer refs/changes/40/225040/1 diff --git a/.jscsrc b/.jscsrc new file mode 100644 index 0000000..9d22e3f --- /dev/null +++ b/.jscsrc @@ -0,0 +1,3 @@ +{ + "preset": "wikimedia" +} diff --git a/.jshintignore b/.jshintignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.jshintignore @@ -0,0 +1 @@ +node_modules diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..66e3d48 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,24 @@ +{ + // Enforcing + "bitwise": true, + "eqeqeq": true, + "freeze": true, + "latedef": true, + "noarg": true, + "nonew": true, + "undef": true, + "unused": true, + "strict": false, + + // Relaxing + "es5": false, + + // Environment + "browser": true, + "jquery": true, + + "globals": { + "mediaWiki": false, + "OO": false + } +} diff --git a/Farmer.i18n.php b/Farmer.i18n.php deleted file mode 100644 index fa8e099..0000000 --- a/Farmer.i18n.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * This is a backwards-compatibility shim, generated by: - * https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php - * - * Beginning with MediaWiki 1.23, translation strings are stored in json files, - * and the EXTENSION.i18n.php file only exists to provide compatibility with - * older releases of MediaWiki. For more information about this migration, see: - * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format - * - * This shim maintains compatibility back to MediaWiki 1.17. - */ -$messages = array(); -if ( !function_exists( 'wfJsonI18nShim0de8654742d79d30' ) ) { - function wfJsonI18nShim0de8654742d79d30( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); - foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json"; - if ( is_readable( $fileName ) ) { - $data = FormatJson::decode( file_get_contents( $fileName ), true ); - foreach ( array_keys( $data ) as $key ) { - if ( $key === '' || $key[0] === '@' ) { - unset( $data[$key] ); - } - } - $cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); - } - - $cachedData['deps'][] = new FileDependency( $fileName ); - } - return true; - } - - $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShim0de8654742d79d30'; -} diff --git a/Farmer.php b/Farmer.php index 1a8780b..657306d 100644 --- a/Farmer.php +++ b/Farmer.php @@ -74,7 +74,6 @@ ); $wgMessagesDirs['MediaWikiFarmer'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['MediaWikiFarmer'] = __DIR__ . '/Farmer.i18n.php'; $wgExtensionMessagesFiles['MediaWikiFarmerAlias'] = __DIR__ . '/Farmer.alias.php'; diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..4538071 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,34 @@ +/*jshint node:true */ +module.exports = function ( grunt ) { + grunt.loadNpmTasks( 'grunt-contrib-jshint' ); + grunt.loadNpmTasks( 'grunt-jsonlint' ); + grunt.loadNpmTasks( 'grunt-banana-checker' ); + grunt.loadNpmTasks( 'grunt-jscs' ); + + grunt.initConfig( { + jshint: { + options: { + jshintrc: true + }, + all: [ + '*.js' + ] + }, + jscs: { + src: '<%= jshint.all %>' + }, + banana: { + all: 'i18n/' + }, + jsonlint: { + all: [ + '*.json', + '**/*.json', + '!node_modules/**' + ] + } + } ); + + grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana' ] ); + grunt.registerTask( 'default', 'test' ); +}; diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..3d55a97 --- /dev/null +++ b/composer.json @@ -0,0 +1,10 @@ +{ + "require-dev": { + "jakub-onderka/php-parallel-lint": "0.9.*" + }, + "scripts": { + "test": [ + "parallel-lint . --exclude vendor" + ] + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..93beca9 --- /dev/null +++ b/package.json @@ -0,0 +1,13 @@ +{ + "scripts": { + "test": "grunt test" + }, + "devDependencies": { + "grunt": "0.4.5", + "grunt-cli": "0.1.13", + "grunt-contrib-jshint": "0.11.2", + "grunt-banana-checker": "0.2.2", + "grunt-jscs": "1.8.0", + "grunt-jsonlint": "1.0.4" + } +} -- To view, visit https://gerrit.wikimedia.org/r/225040 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I04388820caced6f79ec2110d2fc3e9ef5c88ffa3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Farmer Gerrit-Branch: master Gerrit-Owner: Paladox <thomasmulhall...@yahoo.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits