Paladox has uploaded a new change for review.
https://gerrit.wikimedia.org/r/281665
Change subject: Add grunt to npm
......................................................................
Add grunt to npm
Use grunt jshint and jscs.
They use newer versions and there layout for showing success and errors
are much better.
Change-Id: I26b7fe902d84c25cdd189c71197a4db8bb6490b3
---
A Gruntfile.js
M package.json
2 files changed, 51 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid
refs/changes/65/281665/1
diff --git a/Gruntfile.js b/Gruntfile.js
new file mode 100644
index 0000000..93ed514
--- /dev/null
+++ b/Gruntfile.js
@@ -0,0 +1,44 @@
+/*jshint node:true */
+module.exports = function ( grunt ) {
+ grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+ grunt.loadNpmTasks( 'grunt-jscs' );
+ grunt.loadNpmTasks( 'grunt-jsonlint' );
+
+ grunt.initConfig( {
+ jshint: {
+ options: {
+ jshintrc: true
+ },
+ all: [
+ '*.js',
+ 'bin/**/*.js',
+ 'lib/**/*.js',
+ 'tests/**/*.js',
+ 'tools/**/*.js',
+ '!node_modules/**'
+ ]
+ },
+ jscs: {
+ fix: {
+ options: {
+ fix: true
+ },
+ src: '<%= jshint.all %>'
+ },
+ main: {
+ src: '<%= jshint.all %>'
+ }
+ },
+ jsonlint: {
+ all: [
+ '**/*.json',
+ '!node_modules/**'
+ ]
+ }
+ } );
+
+ grunt.registerTask( 'lint', [ 'jshint', 'jscs:main', 'jsonlint' ] );
+ grunt.registerTask( 'fix', 'jscs:fix' );
+ grunt.registerTask( 'test', 'lint' );
+ grunt.registerTask( 'default', 'test' );
+};
diff --git a/package.json b/package.json
index f8739bd..b57826f 100644
--- a/package.json
+++ b/package.json
@@ -34,6 +34,11 @@
"chai": "^3.0.0",
"colors": "^1.1.2",
"coveralls": "^2.11.2",
+ "grunt": "0.4.5",
+ "grunt-cli": "0.1.13",
+ "grunt-contrib-jshint": "1.0.0",
+ "grunt-jscs": "2.8.0",
+ "grunt-jsonlint": "1.0.7",
"istanbul": "^0.3.17",
"jscs": "^2.6.0",
"jshint": "^2.8.0",
@@ -47,12 +52,10 @@
"parse.js": "bin/parse.js"
},
"scripts": {
- "lint": "npm run dump-tokenizer && npm run jscs && npm run jshint",
+ "lint": "npm run dump-tokenizer && npm run grunt lint",
"no-0.8": "node -e 'process.exit(/v0[.][0-8][.]/.test(process.version) ? 0
: 1)' || (npm run nsp && npm run lint)",
"start": "node bin/server.js",
- "jshint": "jshint bin lib tests tools core-upgrade.js",
- "jscs": "jscs bin lib tests tools core-upgrade.js",
- "jscs-fix": "jscs --fix bin lib tests tools core-upgrade.js",
+ "jscs-fix": "grunt fix",
"dump-tokenizer": "node lib/wt2html/tokenizer.js",
"mocha": "mocha --opts tests/mocha/mocha.opts tests/mocha",
"parserTests": "node bin/parserTests.js --wt2html --wt2wt --html2wt
--html2html --selser --no-color --quiet --blacklist",
--
To view, visit https://gerrit.wikimedia.org/r/281665
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I26b7fe902d84c25cdd189c71197a4db8bb6490b3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Paladox <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits