diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | pylint/reporters/json_reporter.py | 3 | ||||
-rw-r--r-- | tests/test_self.py | 1 |
3 files changed, 5 insertions, 2 deletions
@@ -7,6 +7,9 @@ What's New in Pylint 2.5.0? Release date: TBA +* Remove HTML quoting of messages in JSON output. + + Close #2769 * Adjust the `invalid-name` rule to work with non-ASCII identifiers and add the `non-ascii-name` rule. diff --git a/pylint/reporters/json_reporter.py b/pylint/reporters/json_reporter.py index 48c83837f..8cdb82957 100644 --- a/pylint/reporters/json_reporter.py +++ b/pylint/reporters/json_reporter.py @@ -7,7 +7,6 @@ # For details: https://github.com/PyCQA/pylint/blob/master/COPYING """JSON reporter""" -import html import json import sys @@ -37,7 +36,7 @@ class JSONReporter(BaseReporter): "column": msg.column, "path": msg.path, "symbol": msg.symbol, - "message": html.escape(msg.msg or "", quote=False), + "message": msg.msg or "", "message-id": msg.msg_id, } ) diff --git a/tests/test_self.py b/tests/test_self.py index 5cb52a5b4..017bf9a0c 100644 --- a/tests/test_self.py +++ b/tests/test_self.py @@ -347,6 +347,7 @@ class TestRunTC: assert key in message assert message[key] == value assert "invalid syntax" in message["message"].lower() + assert "<unknown>" in message["message"].lower() def test_json_report_when_file_is_missing(self): out = StringIO() |