Skip to content

Commit

Permalink
Merge pull request #218 from SublimeLinter/ignore-stderr-for-json
Browse files Browse the repository at this point in the history
Try to json parse STDOUT only
  • Loading branch information
kaste authored Mar 7, 2018
2 parents 4ecc891 + 65c9d57 commit 2b9ef4f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ def find_errors(self, output):
logger.error(output)
return

# SL core concats STDOUT and STDERR. The json we're after is
# on STDOUT. `lstrip` here is defensive.
stdout = output.lstrip().splitlines()[0]

try:
content = json.loads(output)
content = json.loads(stdout)
except ValueError:
logger.error(output)
logger.error(output) # still log complete output!
return

if logger.isEnabledFor(logging.INFO):
Expand Down

0 comments on commit 2b9ef4f

Please sign in to comment.