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

Make simplecov json formatter more flexible #488

Merged
merged 4 commits into from
Feb 15, 2022

Conversation

fede-moya
Copy link
Contributor

simplecov_json_formatter's json report now contains an extra key, named groups. This was included on codeclimate-community/simplecov_json_formatter#2 . The current approach for decoding the JSON report into a predefined struct is too rigid due to the use of DisallowUnkownFields().

DisallowUnknownFields causes the Decoder to return an error when the destination is a struct and the input contains object keys which do not match any non-ignored, exported fields in the destination.
Godoc

That explains why the test report will fail to decode the new simplecov_json_formatter report, since it has a new key groups which is not declared on the struct.

This DisallowUknownFields() was use as a strategy to detect when the given simplecov report is on legacy format (simplecov < 0.18). I'm changing the strategy to extract the simplecov version from the test report and make a decision about with simplecov formatter to use based on that.

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 this pull request may close these issues.

None yet

3 participants