Page MenuHomePhabricator

JSON linter does not catch syntax errors
Closed, ResolvedPublic

Description

In gerrit 122270, a line in JSON contained the following:

"key" => "value",

The Jenkins jobs for the Scribunto extension, and in particular the job jslint I believe, didn't disapprove of this, even though it is invalid JSON.

https://integration.wikimedia.org/ci/job/mwext-Scribunto-jslint/598/console is the job output.

Expected behaviour: JSON linter should catch JSON syntax errors and jobs running this linter should fail in such cases.

I set the severity for this issue to major.


Version: wmf-deployment
Severity: major
URL: https://gerrit.wikimedia.org/r/#/c/122270/1/i18n/qqq.json,unified

Details

Reference
bz63293

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:58 AM
bzimport set Reference to bz63293.
bzimport added a subscriber: Unknown Object (MLST).

For comparison:

$ json_verify < i18n/qqq.json
lexical error: invalid char in json text.

                   {     "@metadata": {         "
(right here) ------^

JSON is invalid

Json files are not validated yet. Need to add to the jslint jobs the json_decode() wrapper I wrote which is bug 58279. I forgot to deploy it last week.

  • This bug has been marked as a duplicate of bug 58279 ***