Last modified: 2014-04-02 13:08:27 UTC
I wrote a quick PHP based json linter which detects error in the mediawiki/service/parsoid/deploy repository: ./node_modules/es6-shim/bower.json: Syntax error ./node_modules/es6-shim/component.json: Syntax error There are missing comma in a dictionaries. 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-lint.php '> /tmp/json-lint.php Usage: json-lint.php . Would be nice to have them fixed either locally or upstream.
I would like to have Jenkins to lint json starting next Monday March 17th.
@Antoine: Is there an easy way to tell Jenkins to ignore node_modules? Those are all third party libraries for which Jenkins testing is less useful.
Well both files were broken and fixed by upstream fairly recently. bower.js by: https://github.com/paulmillr/es6-shim/commit/0b931c2b78a844e9349f18756e7f72cf0409eae4#diff-0a08a7565aba4405282251491979bb6b component.js by: https://github.com/paulmillr/es6-shim/commit/644944e47fcfb4b42833016083e125e2a62bcf62 Both apparently got introduced with 0.10.0 of es6-shim. ------------------------- The json-lint.php script I wrote does not support ignore list like jshint does. One can probably implement such a system by hacking the file in integration/jenkins.git, though I see little point in accepting invalid json even from third parties.
(In reply to Antoine "hashar" Musso from comment #3) > The json-lint.php script I wrote does not support ignore list like jshint > does. One can probably implement such a system by hacking the file in > integration/jenkins.git, though I see little point in accepting invalid json > even from third parties. Those json files might not be used, are not edited by us etc. So if there is no way to ignore node_modules then at least this pass should be non-voting to avoid holding up our work. Could you just add a special case to ignore node_modules?
There's now a new release of es6-shim (v0.10.1) which should address this issue ... or at least until the next node_module breaks it.
Change 118762 had a related patch set uploaded by Hashar: Update to es6-shim 0.10.1. https://gerrit.wikimedia.org/r/118762
Change 118762 merged by jenkins-bot: Update to es6-shim 0.10.1. https://gerrit.wikimedia.org/r/118762
Got fixed by updating the upstream node module.