Hashar has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/390994 )
Change subject: Add linters for i18n json files
......................................................................
Add linters for i18n json files
Validate files under /i18n/ are proper json and that they match our
conventions (via 'banana').
Usage:
npm install
npm test
Bug: T180328
Depends-On: I763c8e3b8651bd924a397a6d567901d2641ad29d
Change-Id: I8259667c0f6d2af2402dc78bb08f384631f17e7d
---
A .gitignore
A Gruntfile.js
M README.md
A package.json
4 files changed, 32 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/dumps/dcat
refs/changes/94/390994/1
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..2ccbe46
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/node_modules/
diff --git a/Gruntfile.js b/Gruntfile.js
new file mode 100644
index 0000000..6b00f4b
--- /dev/null
+++ b/Gruntfile.js
@@ -0,0 +1,19 @@
+/* eslint-env node */
+module.exports = function ( grunt ) {
+ grunt.loadNpmTasks( 'grunt-banana-checker' );
+ grunt.loadNpmTasks( 'grunt-jsonlint' );
+
+ grunt.initConfig( {
+ banana: 'i18n',
+ jsonlint: {
+ all: [
+ '**/*.json',
+ '!node_modules/**',
+ '!vendor/**'
+ ]
+ }
+ } );
+
+ grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
+ grunt.registerTask( 'default', 'test' );
+};
diff --git a/README.md b/README.md
index 76fb017..6c7d169 100644
--- a/README.md
+++ b/README.md
@@ -44,7 +44,7 @@
* Translations which are specific to a project/catalog are added to
the location specified in the `catalog-i18n` parameter of the config
file.
-
+* To lint translations files: npm install && npm test.
## Config
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..cca4845
--- /dev/null
+++ b/package.json
@@ -0,0 +1,11 @@
+{
+ "private": true,
+ "scripts": {
+ "test": "grunt test"
+ },
+ "devDependencies": {
+ "grunt": "1.0.1",
+ "grunt-banana-checker": "0.6.0",
+ "grunt-jsonlint": "1.1.0"
+ }
+}
--
To view, visit https://gerrit.wikimedia.org/r/390994
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8259667c0f6d2af2402dc78bb08f384631f17e7d
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps/dcat
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits