Update Jenkins tests

Run jshint through npm instead.

Also add composer.json to run phplint and in future run the php code sniffer.

Signed-off-by: Antoine Musso <hashar@free.fr>
Change-Id: I1797ac2bce1936ed75da76618f28fc239b60001b
This commit is contained in:
paladox 2015-11-16 19:26:56 +00:00 committed by Antoine Musso
parent ae860e5a5e
commit 11a683dd07
6 changed files with 58 additions and 8 deletions

5
.gitignore vendored
View file

@ -1,6 +1,7 @@
.svn
*~
*.kate-swp
.*.swp
.idea
node_modules/
/node_modules/
/vendor/
/composer.lock

2
.jshintignore Normal file
View file

@ -0,0 +1,2 @@
node_modules
vendor

24
.jshintrc Normal file
View file

@ -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
}
}

View file

@ -1,19 +1,31 @@
/*jshint node:true */
module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
var conf = grunt.file.readJSON( 'extension.json' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.initConfig( {
jshint: {
options: {
jshintrc: true
},
all: [
'**/*.js',
'!node_modules/**',
'!vendor/**'
]
},
banana: conf.MessagesDirs,
jsonlint: {
all: [
'**/*.json',
'!node_modules/**'
'!node_modules/**',
'!vendor/**'
]
}
} );
grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
grunt.registerTask( 'test', [ 'jshint', 'jsonlint', 'banana' ] );
grunt.registerTask( 'default', 'test' );
};

10
composer.json Normal file
View file

@ -0,0 +1,10 @@
{
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9"
},
"scripts": {
"test": [
"parallel-lint . --exclude node_modules --exclude vendor"
]
}
}

View file

@ -9,7 +9,8 @@
"devDependencies": {
"grunt": "0.4.5",
"grunt-cli": "0.1.13",
"grunt-contrib-jshint": "0.11.3",
"grunt-banana-checker": "0.4.0",
"grunt-jsonlint": "1.0.4"
"grunt-jsonlint": "1.0.6"
}
}