[MediaWiki-commits] [Gerrit] Add grunt linting tasks - change (mediawiki...Score)

2015-10-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add grunt linting tasks
..


Add grunt linting tasks

Change-Id: Ida8ec3de35d810ebb21176bf71359b16c0c29049
---
A .csslintrc
A .jscsrc
A .jshintignore
A .jshintrc
M Gruntfile.js
M i18n/ce.json
M i18n/de.json
M i18n/es.json
M i18n/eu.json
M i18n/fr.json
M i18n/he.json
M i18n/it.json
M i18n/ja.json
M i18n/ko.json
M i18n/ksh.json
M i18n/lb.json
M i18n/mk.json
M i18n/nl.json
M i18n/pl.json
M i18n/pt.json
M i18n/sv.json
M i18n/ta.json
M i18n/vi.json
M i18n/zh-hans.json
M package.json
25 files changed, 102 insertions(+), 34 deletions(-)

Approvals:
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.csslintrc b/.csslintrc
new file mode 100644
index 000..68d60d2
--- /dev/null
+++ b/.csslintrc
@@ -0,0 +1,13 @@
+{
+   "adjoining-classes": false,
+   "box-model": false,
+   "box-sizing": false,
+   "fallback-colors": false,
+   "important": false,
+   "outline-none": false,
+   "qualified-headings": false,
+   "unique-headings": false,
+   "universal-selector": false,
+   "unqualified-attributes": false,
+   "gradients": false
+}
diff --git a/.jscsrc b/.jscsrc
new file mode 100644
index 000..1959eea
--- /dev/null
+++ b/.jscsrc
@@ -0,0 +1,21 @@
+{
+   "preset": "wikimedia",
+
+   "jsDoc": {
+   "checkAnnotations": {
+   "preset": "jsduck5",
+   "extra": {
+   "this": true,
+   "source": true,
+   "see": true
+   }
+   },
+   "checkTypes": "strictNativeCase",
+   "checkParamNames": true,
+   "checkRedundantAccess": true,
+   "checkRedundantReturns": true,
+   "requireNewlineAfterDescription": true,
+   "requireParamTypes": true,
+   "requireReturnTypes": true
+   }
+}
diff --git a/.jshintignore b/.jshintignore
new file mode 100644
index 000..ff3cfde
--- /dev/null
+++ b/.jshintignore
@@ -0,0 +1,2 @@
+/* Tooling */
+node_modules/
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 000..b0a9b23
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,25 @@
+{
+   // 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,
+   "ve": false
+   }
+}
diff --git a/Gruntfile.js b/Gruntfile.js
index 9c56558..a2f24cf 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,10 +1,43 @@
 /*jshint node:true */
 module.exports = function ( grunt ) {
+   grunt.loadNpmTasks( 'grunt-contrib-csslint' );
+   grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+   grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
+   grunt.loadNpmTasks( 'grunt-jscs' );
 
grunt.initConfig( {
+   jshint: {
+   options: {
+   jshintrc: true
+   },
+   all: [
+   '*.js',
+   'js/*.js',
+   'modules/ve-score/**/*.js'
+   ]
+   },
+   jscs: {
+   src: '<%= jshint.all %>'
+   },
+   csslint: {
+   options: {
+   csslintrc: '.csslintrc'
+   },
+   all: 'modules/ve-score/**/*.css'
+   },
+   watch: {
+   files: [
+   '.{jscsrc,jshintignore,jshintrc}',
+   '<%= jshint.all %>'
+   ],
+   tasks: 'lint'
+   },
banana: {
+   options: {
+   disallowDuplicateTranslations: false
+   },
all: 'i18n/'
},
jsonlint: {
@@ -15,6 +48,7 @@
}
} );
 
-   grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
+   grunt.registerTask( 'lint', [ 'jshint', 'jscs', 'jsonlint', 'csslint', 
'banana' ] );
+   grunt.registerTask( 'test', 'lint' );
grunt.registerTask( 'default', 'test' );
 };
diff --git a/i18n/ce.json b/i18n/ce.json
index c24d12d..85e111a 100644
--- a/i18n/ce.json
+++ b/i18n/ce.json
@@ -6,6 +6,5 @@
},

[MediaWiki-commits] [Gerrit] Add grunt linting tasks - change (mediawiki...Score)

2015-10-04 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/243523

Change subject: Add grunt linting tasks
..

Add grunt linting tasks

Change-Id: Ida8ec3de35d810ebb21176bf71359b16c0c29049
---
M Gruntfile.js
M package.json
2 files changed, 40 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Score 
refs/changes/23/243523/1

diff --git a/Gruntfile.js b/Gruntfile.js
index 9c56558..a2f24cf 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,10 +1,43 @@
 /*jshint node:true */
 module.exports = function ( grunt ) {
+   grunt.loadNpmTasks( 'grunt-contrib-csslint' );
+   grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+   grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
+   grunt.loadNpmTasks( 'grunt-jscs' );
 
grunt.initConfig( {
+   jshint: {
+   options: {
+   jshintrc: true
+   },
+   all: [
+   '*.js',
+   'js/*.js',
+   'modules/ve-score/**/*.js'
+   ]
+   },
+   jscs: {
+   src: '<%= jshint.all %>'
+   },
+   csslint: {
+   options: {
+   csslintrc: '.csslintrc'
+   },
+   all: 'modules/ve-score/**/*.css'
+   },
+   watch: {
+   files: [
+   '.{jscsrc,jshintignore,jshintrc}',
+   '<%= jshint.all %>'
+   ],
+   tasks: 'lint'
+   },
banana: {
+   options: {
+   disallowDuplicateTranslations: false
+   },
all: 'i18n/'
},
jsonlint: {
@@ -15,6 +48,7 @@
}
} );
 
-   grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
+   grunt.registerTask( 'lint', [ 'jshint', 'jscs', 'jsonlint', 'csslint', 
'banana' ] );
+   grunt.registerTask( 'test', 'lint' );
grunt.registerTask( 'default', 'test' );
 };
diff --git a/package.json b/package.json
index 76e8a82..b6086db 100644
--- a/package.json
+++ b/package.json
@@ -6,7 +6,11 @@
   "devDependencies": {
 "grunt": "0.4.5",
 "grunt-cli": "0.1.13",
-"grunt-banana-checker": "0.2.2",
+"grunt-contrib-csslint": "0.5.0",
+"grunt-contrib-jshint": "0.11.3",
+"grunt-contrib-watch": "0.6.1",
+"grunt-jscs": "2.1.0",
+"grunt-banana-checker": "0.3.0",
 "grunt-jsonlint": "1.0.4"
   }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/243523
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ida8ec3de35d810ebb21176bf71359b16c0c29049
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Score
Gerrit-Branch: master
Gerrit-Owner: Esanders 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits