dmeranda / demjson

Python module for JSON data encoding, including jsonlint. See the project Wiki here on Github. Also read the README at the bottom of this page, or the project homepage at
http://deron.meranda.us/python/demjson/
Other
302 stars 76 forks source link

jsonlint return value is wrong #12

Closed dmeranda closed 9 years ago

dmeranda commented 9 years ago

It has been reported by @mattboyer (pull request https://github.com/dmeranda/demjson/pull/10 ) and @jannepeltola (pull request https://github.com/dmeranda/demjson/pull/11 ) that the "jsonlint" command line does not always return the expected return value. When feed incorrect JSON it may still return a value of 0 rather than a non-zero error value.

$ echo '{ "abc": [1, 2  }' | jsonlint -v
<stdin>:1:16: Error: Expected a ']' but saw '}'
   |  At line 1, column 16, offset 16
   |  Array started at line 1, column 9, offset 9
<stdin>: has errors

$ echo $?
0

$ jsonlint --version
jsonlint (demjson) version 2.2.2 (2014-06-25)
dmeranda commented 9 years ago

Fixed in commit 98d84a8ea1c81a7798621e7a99f817e3046fe8be — Release 2.2.3