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

[feature request] new output format for Code Climate #512

Open
Blaimi opened this issue Nov 6, 2022 · 5 comments · May be fixed by #590
Open

[feature request] new output format for Code Climate #512

Blaimi opened this issue Nov 6, 2022 · 5 comments · May be fixed by #590

Comments

@Blaimi
Copy link
Contributor

Blaimi commented Nov 6, 2022

For the integration of the validation results in other software, it would be nice to have the possibility to get the output as json as specified by Code Climate. Especially the integration in gitlab-ci requires this format.

https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#data-types

@rmkeezer rmkeezer added the enhancement New feature or request label Nov 30, 2022
@dpopp07 dpopp07 removed the enhancement New feature or request label Nov 30, 2022
@dpopp07
Copy link
Member

dpopp07 commented Nov 30, 2022

@Blaimi Are you using the validator as a Node module within JavaScript code or as a CLI tool?

@Blaimi
Copy link
Contributor Author

Blaimi commented Dec 1, 2022

I want to use it in a gitlab-pipeline [1]. gitlab requires the code climate output format for integration in code quality reports [2].

[1] https://gitlab.com/biletado/apidocs/-/blob/0dfa977c8cc38282dada77f50c8db151f5e6926d/.gitlab-ci.yml#L6
[2] https://docs.gitlab.com/ee/ci/testing/code_quality.html#implementing-a-custom-tool

@dpopp07
Copy link
Member

dpopp07 commented Dec 1, 2022

I see. So it's not sufficient just to have JSON output, you need an entirely new output structure?

@padamstx
Copy link
Member

padamstx commented May 4, 2023

@Blaimi in our official 1.0.0 release of the validator, we have defined a json schema that describes the JSON output produced by the validator. Perhaps a way to solve this would be to use a tool such as jq to post-process the validator's JSON output to produce the correct format needed by Code Climate.

@Blaimi
Copy link
Contributor Author

Blaimi commented May 4, 2023

Yes, I considered jq for a few moments, but when I remember correct, the structures are too different for an easy and maintainable solution. It's probably easier to write a small node tool or wrapper in a oop language which transforms the output.

Would you accept a PR on this topic with an implementation? e.g. with outputFormat: codeclimate/--codeclimate?

Blaimi added a commit to Blaimi/openapi-validator that referenced this issue May 6, 2023
Signed-off-by: Matthias Blümel <blaimi@blaimi.de>
@Blaimi Blaimi linked a pull request May 6, 2023 that will close this issue
12 tasks
Blaimi added a commit to Blaimi/openapi-validator that referenced this issue May 25, 2023
Signed-off-by: Matthias Blümel <blaimi@blaimi.de>
Blaimi added a commit to Blaimi/openapi-validator that referenced this issue May 25, 2023
Signed-off-by: Matthias Blümel <blaimi@blaimi.de>
Blaimi added a commit to Blaimi/openapi-validator that referenced this issue May 25, 2023
Signed-off-by: Matthias Blümel <blaimi@blaimi.de>
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

Successfully merging a pull request may close this issue.

4 participants