Skip to content

Commit 2b9ef4f

Browse files
authored
Merge pull request #218 from SublimeLinter/ignore-stderr-for-json
Try to json parse STDOUT only
2 parents 4ecc891 + 65c9d57 commit 2b9ef4f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

linter.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,14 @@ def find_errors(self, output):
4444
logger.error(output)
4545
return
4646

47+
# SL core concats STDOUT and STDERR. The json we're after is
48+
# on STDOUT. `lstrip` here is defensive.
49+
stdout = output.lstrip().splitlines()[0]
50+
4751
try:
48-
content = json.loads(output)
52+
content = json.loads(stdout)
4953
except ValueError:
50-
logger.error(output)
54+
logger.error(output) # still log complete output!
5155
return
5256

5357
if logger.isEnabledFor(logging.INFO):

0 commit comments

Comments
 (0)