Hello,
Sonar scanner returns problem with parsing CloudFormation JSON file when there is any empty line.
It should be considered as a bug because breakline is valid JSON character.
Example:
{
"AWSTemplateFormatVersion": "2010-09-09",
"Resources": {
"Topic": {
"Type": "AWS::SNS::Topic"
}
}
}
Output:
|29-Jul-2022 10:39:35|ERROR: Unable to parse file: file:///MY_PATH/MY_FILE.json. Parse error at position 4:0|
|---|---|
|29-Jul-2022 10:39:35|ERROR: Cannot parse 'PATH/MY_FILE.json': while parsing a flow mapping|
|29-Jul-2022 10:39:35|in reader, line 1, column 1:|
|29-Jul-2022 10:39:35| {|
|29-Jul-2022 10:39:35| ^|
|29-Jul-2022 10:39:35|expected ',' or '}', but got ?|
|29-Jul-2022 10:39:35|in reader, line 4, column 3:|
|29-Jul-2022 10:39:35| Resources: {|
29-Jul-2022 10:39:35 ^
Our Sonarqube version: 9.5
SonarScanner: 4.7.0.2747