- SonarQube 9.1 Enterprise
- SonarScanner 4.6.2.2472
- Receiving parse errors for COBOL file in windows-1252 charset
- Tried to set the COBOL source format to ‘variable’ through properties
- Tried reviewing documentation, github sources and examples
- Tried some “obvious” property names:
- sonar.cobol.format=variable
- sonar.cobol.file.format=variable
- sonar.cobol.fileFormat=variable
- sonar.cobol.sourceCodeFormat=variable
- sonar.cobol.file.sourceCodeFormat=variable
We are receiving parse errors for a set of COBOL sources in various dialects, e.g. ibm-os/vs-cobol
INFO: About to analyse COBOL Programs using 'ibm-os/vs-cobol' dialect and 'fixed' source code format.
DEBUG: 'FILE.cbl' generated metadata with charset 'windows-1252'
ERROR: Unable to parse COBOL source file : D:\Jenkins\workspace\FILE.cbl at line 33
Original contents starting from...
00032 DATACOM SECTION
00033 ID-AREA IS ID-AREA-IDENT
Preprocessed contents:
Parse error at line 33:
33: ID-AREA IS ID-AREA-IDENT
^
We are trying to determine if the parse error is due to the charset, the COBOL dialect, or because we need to define the source code format to be ‘variable’. However, I do not have access to the SonarQube instance to change the format through the GUI. I cannot find any information on how to define the format via properties, such as how sonar.cobol.dialect can be defined.
If it’s possible to set the COBOL dialect via properties, should we be able to set the source code format as well?
This documentation mentions the supported formats but gives no indication of a way to set it at runtime:
https://docs.sonarqube.org/latest/analysis/languages/cobol/
This documentation mentions a couple COBOL properties, but doesn’t even mention sonar.cobol.dialect:
https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/
And this documentation doesn’t have much information at all about all the supported runtime properties:
https://docs.sonarqube.org/latest/analysis/analysis-parameters/
Any help would be appreciated. Thanks!