X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=Gruntfile.js;h=a08db5c780ad06ba46602e9a3fddedffb0da1b13;hb=4f12dc25e773c452b826ed6253c41865011f9775;hp=e1e5e4ab01721a898d113d37f1b48ceb6272067d;hpb=02f609e06889a172c64a863481cc5f692f86e64a;p=lhc%2Fweb%2Fwiklou.git diff --git a/Gruntfile.js b/Gruntfile.js index e1e5e4ab01..a08db5c780 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -2,6 +2,7 @@ module.exports = function ( grunt ) { grunt.loadNpmTasks( 'grunt-contrib-copy' ); grunt.loadNpmTasks( 'grunt-contrib-jshint' ); + grunt.loadNpmTasks( 'grunt-stylelint' ); grunt.loadNpmTasks( 'grunt-contrib-watch' ); grunt.loadNpmTasks( 'grunt-banana-checker' ); grunt.loadNpmTasks( 'grunt-jscs' ); @@ -12,7 +13,7 @@ module.exports = function ( grunt ) { wgScriptPath = process.env.MW_SCRIPT_PATH, karmaProxy = {}; - karmaProxy[wgScriptPath] = wgServer + wgScriptPath; + karmaProxy[ wgScriptPath ] = wgServer + wgScriptPath; grunt.initConfig( { jshint: { @@ -32,13 +33,22 @@ module.exports = function ( grunt ) { ] }, banana: { + options: { + disallowBlankTranslations: false + }, core: 'languages/i18n/', api: 'includes/api/i18n/', installer: 'includes/installer/i18n/' }, + stylelint: { + options: { + syntax: 'less' + }, + src: '{resources/src/*,mw-config/**}/*.{css,less}' + }, watch: { files: [ - '.js*', + '.{stylelintrc,jscsrc,jshintignore,jshintrc}', '**/*', '!{docs,extensions,node_modules,skins,vendor}/**' ], @@ -53,8 +63,9 @@ module.exports = function ( grunt ) { included: true, served: false } ], + logLevel: 'DEBUG', frameworks: [ 'qunit' ], - reporters: [ 'dots' ], + reporters: [ 'progress' ], singleRun: true, autoWatch: false, // Some tests in extensions don't yield for more than the default 10s (T89075) @@ -87,14 +98,14 @@ module.exports = function ( grunt ) { } if ( !process.env.MW_SCRIPT_PATH ) { grunt.log.error( 'Environment variable MW_SCRIPT_PATH must be set.\n' + - 'Set this like $wgScriptPath, e.g. "/w"'); + 'Set this like $wgScriptPath, e.g. "/w"' ); } return !!( process.env.MW_SERVER && process.env.MW_SCRIPT_PATH ); } ); - grunt.registerTask( 'lint', ['jshint', 'jscs', 'jsonlint', 'banana'] ); + grunt.registerTask( 'lint', [ 'jshint', 'jscs', 'jsonlint', 'banana', 'stylelint' ] ); grunt.registerTask( 'qunit', [ 'assert-mw-env', 'karma:main' ] ); - grunt.registerTask( 'test', ['lint'] ); + grunt.registerTask( 'test', [ 'lint' ] ); grunt.registerTask( 'default', 'test' ); };