Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails on correctly-formatted tslint report #32

Closed
EarthCitizen opened this issue Jun 17, 2016 · 2 comments
Closed

Fails on correctly-formatted tslint report #32

EarthCitizen opened this issue Jun 17, 2016 · 2 comments

Comments

@EarthCitizen
Copy link

I have the following tslint report:

[{
    "endPosition": {
        "character": 6,
        "line": 22,
        "position": 885
    },
    "failure": "block is empty",
    "name": "src/file.ts",
    "ruleName": "no-empty",
    "startPosition": {
        "character": 4,
        "line": 22,
        "position": 883
    }
}]

When running Sonar I get the following error:

Caused by: fr.sii.sonar.report.core.common.exception.ProviderException: failed to parse json file. Cause: Can not deserialize instance of fr.sii.sonar.report.core.quality.domain.report.QualityReport out of START_ARRAY token
 at [Source: java.io.InputStreamReader@4407f129; line: 1, column: 1]
    at fr.sii.sonar.report.core.common.provider.JsonFileReportProvider.get(JsonFileReportProvider.java:55)
    at fr.sii.sonar.report.core.common.ReportSensor.analyse(ReportSensor.java:106)
    ... 91 more
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of fr.sii.sonar.report.core.quality.domain.report.QualityReport out of START_ARRAY token
 at [Source: java.io.InputStreamReader@4407f129; line: 1, column: 1]
    at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:148)
    at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:854)
    at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:850)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromArray(BeanDeserializerBase.java:1257)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:155)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:134)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3731)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2778)
    at fr.sii.sonar.report.core.common.provider.JsonFileReportProvider.get(JsonFileReportProvider.java:51)
    ... 92 more

Looking at the code, it seems that the plug-in is not properly set up to consume tslint JSON.

@aurelien-baudet
Copy link
Member

Hi,

The plugin doesn't take the report directly generated by TSLint. You have to use our own gulp tasks (see https://github.com/groupe-sii/sonar-web-frontend-reporters) that generates a more complete report.

@EarthCitizen
Copy link
Author

EarthCitizen commented Jun 20, 2016

OK. It might be a good idea to change this line in the README.md to be a little more specific:

"The reports are either directly produced by the tools or by our gulp tasks."

As it is, it sounds like the tslint generated reports would be directly consumable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants