sonar-gitlab-plugin
sonar-gitlab-plugin copied to clipboard
Newline in the issue message are not escaped when building the json
If the message of an issue contain a newline (\n
) character, it isn't escaped line when the codeclimate.json
file is generated. This means that the value for the "check_name" key contains an new line character. This makes the json invalid and Gitlab then fail to parse it.
Hi, Have you example for json file ? Thanks
gl-code-quality-report.json.txt
I replaced potentially sensitive information by --removed--
.
The issue come from https://github.com/mwz/sonar-scala
Bug is here https://github.com/gabrie-allaigre/sonar-gitlab-plugin/blob/master/src/main/java/com/talanlabs/sonar/plugins/gitlab/Reporter.java#L263
According to https://tools.ietf.org/html/rfc4627 and http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf, all character with value < 32 should be escaped, not only the new line.