Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error types need to converted into booleans #11

Closed
wants to merge 1 commit into from

Conversation

jannepeltola
Copy link

I noticed that jsonlint return values don’t work properly. Code outside this method treats these values as booleans.

Steps to reproduce:

tmp $ cat test.json
{
    "foo" : [ 1,2,3]
}
tmp $ jsonlint test.json
test.json: ok
tmp $ echo $?
0
tmp $ cat test.json
{
    "foo" : [ 1,2,3
}
tmp $ jsonlint test.json
test.json:3:0: Error: Expected a ']' but saw '}'
   |  At line 3, column 0, offset 22
   |  Array started at line 2, column 12, offset 14
test.json: has errors
tmp $ echo $?
0

$? should be 1, and after applying the attached patch it is.

Return values don’t work properly otherwise and all other code treats
these values as booleans.
@dmeranda
Copy link
Owner

I have opened Issue #12 to track this bug; you may subscribe to it if you want. This bug has been reported by multiple people and will be fixed shortly. Thanks for your suggested patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants