Skip to content

Commit

Permalink
unescape the messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jgsogo committed Feb 27, 2019
1 parent 61abc52 commit 8593926
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions conans/client/cmd/export_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import sys
from subprocess import PIPE, Popen

from six.moves.html_parser import HTMLParser

from conans import __path__ as root_path
from conans.client.output import Color
from conans.errors import ConanException
Expand Down Expand Up @@ -72,15 +74,17 @@ def _accept_message(msg):

return True

h = HTMLParser()
result = []
py3msgs = []
for msg in output_json:
if msg.get("type") in ("warning", "error"):
message_id = msg.get("symbol")
message = h.unescape(msg.get('message'))
if message_id in ("print-statement", "dict-iter-method"):
py3msgs.append("Py3 incompatibility. Line %s: %s"
% (msg.get("line"), msg.get("message")))
% (msg.get("line"), message))
elif _accept_message(msg):
result.append("Linter. Line %s: %s" % (msg.get("line"), msg.get("message")))
result.append("Linter. Line %s: %s" % (msg.get("line"), message))

return result, py3msgs

0 comments on commit 8593926

Please sign in to comment.