Le 10/03/2014 17:26, Antoine Musso a écrit :
Hello,
I wrote a PHP based JSON linter which would bail out whenever a json file can't be understood by PHP json_decode().
The linter will be able to the jslint Jenkins jobs which are already running jshint. It would be nice to pass it on your repositories to avoid failure when the job is enable which I plan to do next Monday on March 17th.
The lint script is in integration/jenkins.git bin/json-lint.php which you can fetch with:
curl 'http://git.wikimedia.org/raw/integration%2Fjenkins.git/master/bin%2Fjson-lin... '> /tmp/json-lint.php
Usage:
json-lint.php .
Example output:
./node_modules/es6-shim/bower.json: Syntax error ./node_modules/es6-shim/component.json: Syntax error
They are missing comma in dictionaries structures of the git repository mediawiki/services/parsoid/deploy
I have passed the scripts against mediawiki/extensions/* and mw/core but other repository would need to be verified if they have a jslint job running.
Forgot to deploy the json linter last week. This is now deployed on all 275 jslint jobs currently configured.
If there is any error report, do fix the json files!