Use new banana checker as a linter to avoid lacking qqq messages
[lhc/web/wiklou.git] / tests / frontend / Gruntfile.js
1 /*!
2 * Grunt file
3 */
4
5 /*jshint node:true */
6 module.exports = function ( grunt ) {
7 grunt.loadNpmTasks( 'grunt-contrib-jshint' );
8 grunt.loadNpmTasks( 'grunt-banana-checker' );
9 grunt.loadNpmTasks( 'grunt-contrib-watch' );
10 grunt.loadNpmTasks( 'grunt-jscs-checker' );
11
12 grunt.file.setBase( __dirname + '/../..' );
13
14 grunt.initConfig( {
15 pkg: grunt.file.readJSON( __dirname + '/package.json' ),
16 jshint: {
17 options: {
18 jshintrc: '.jshintrc'
19 },
20 all: [ '*.js', '{includes,languages,resources,skins,tests}/**/*.js' ]
21 },
22 jscs: {
23 // Known issues:
24 // - https://github.com/mdevils/node-jscs/issues/277
25 // - https://github.com/mdevils/node-jscs/issues/278
26 all: [
27 '<%= jshint.all %>',
28 // Auto-generated file with JSON (double quotes)
29 '!tests/qunit/data/mediawiki.jqueryMsg.data.js'
30
31 // Exclude all files ignored by jshint
32 ].concat( grunt.file.read( '.jshintignore' ).split( '\n' ).reduce( function ( patterns, pattern ) {
33 // Filter out empty lines
34 if ( pattern.length && pattern[0] !== '#' ) {
35 patterns.push( '!' + pattern );
36 }
37 return patterns;
38 }, [] ) )
39 },
40 banana: {
41 core: 'languages/i18n/',
42 installer: 'includes/installer/i18n/'
43 },
44 watch: {
45 files: [
46 '.{jshintrc,jscs.json,jshintignore,csslintrc}',
47 '<%= jshint.all %>'
48 ],
49 tasks: ['test']
50 }
51 } );
52
53 grunt.registerTask( 'lint', ['jshint', 'jscs', 'banana'] );
54 grunt.registerTask( 'test', ['lint'] );
55 grunt.registerTask( 'default', ['test'] );
56 };