Skip to content

Add explicit serialization / deserialization to the JsonReporter #7077

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

Conversation

Pierre-Sassoulas
Copy link
Member

Type of Changes

Type
✨ New feature

Description

Necessary for Refs #7000

@Pierre-Sassoulas Pierre-Sassoulas added the Maintenance Discussion or action around maintaining pylint or the dev workflow label Jun 27, 2022
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the deserialize-from-json-reporter branch from 8682180 to 599e9bc Compare June 27, 2022 14:36
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@coveralls
Copy link

coveralls commented Jun 27, 2022

Pull Request Test Coverage Report for Build 2581426689

  • 25 of 25 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.006%) to 95.331%

Totals Coverage Status
Change from base Build 2580923231: 0.006%
Covered Lines: 16680
Relevant Lines: 17497

💛 - Coveralls

Copy link
Collaborator

@DanielNoord DanielNoord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pierre-Sassoulas What is the bug/issue we're trying to solve here?

@Pierre-Sassoulas
Copy link
Member Author

The goal is to be able to use the message object in the primer instead of a complicated to type dict from the JSON reporter. I identified the issue of confidence and abspath that were lost in the reporting thanks to this.

@DanielNoord
Copy link
Collaborator

Should we consider adding those? Adding new keys to a JSON result shouldn't really break anything right?

@Pierre-Sassoulas
Copy link
Member Author

It's a breaking change depending on the implementation ? Say if someone loop on it and try to assign each value to something and it error on unknown value.

@DanielNoord
Copy link
Collaborator

It's a breaking change depending on the implementation ? Say if someone loop on it and try to assign each value to something and it error on unknown value.

Hmm yeah. We really should provide a json-version-2, but I haven't gotten to it yet.

@Pierre-Sassoulas
Copy link
Member Author

We really should provide a json-version-2, but I haven't gotten to it yet.

Silly me, we just have to add a JsonReporter and deprecate the old one ?

@DanielNoord
Copy link
Collaborator

Silly me, we just have to add a JsonReporter and deprecate the old one ?

Yeah, but we also need to fix some of the issues that are currently in the beta of 3.0. That's why I haven't gotten to it.

@Pierre-Sassoulas
Copy link
Member Author

Hmm ok. Seems we can deal with it later and merge this one then ?

@DanielNoord
Copy link
Collaborator

Hmm ok. Seems we can deal with it later and merge this one then ?

Well, this is a bit of a handicapped solution. I'd prefer tackling the actual problem, but if you don't have the time for that now I guess this should would be okay?

@Pierre-Sassoulas
Copy link
Member Author

Pierre-Sassoulas commented Jun 28, 2022

I'm not trying to fix the missing confidence / abspath in the json right now, it's just an issue I realized existed while doing what's necessary to use pylint.message.Message instance in the primer (which is itself an issue I realized existed when trying to do a generic comparator, which is a refactor I'm doing because I want to have a better diff in the primer when messages did not move 😄).

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Pierre-Sassoulas Pierre-Sassoulas force-pushed the deserialize-from-json-reporter branch from 92e336f to 5a6e76f Compare June 28, 2022 11:57
@github-actions

This comment has been minimized.

@Pierre-Sassoulas Pierre-Sassoulas force-pushed the deserialize-from-json-reporter branch from 9e1c6fc to eb2e20c Compare June 28, 2022 14:14
@github-actions

This comment has been minimized.

@Pierre-Sassoulas
Copy link
Member Author

@DanielNoord can you review this again please ? I added the typed dict :) I have multiple PR ready as follow-up but I don't want to put too much into this one.

@Pierre-Sassoulas
Copy link
Member Author

TypedDict is not available in some python version this is why i added it in the type checking guard.

Copy link
Collaborator

@DanielNoord DanielNoord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed some changes which were a bit hard to suggest using the interface.

Let's make the types of the serialisation more explicit and add types of we need to.

@DanielNoord
Copy link
Collaborator

TypedDict is not available in some python version this is why i added it in the type checking guard.

Whenever typing stuff is unavailable on older versions we tend to put those under sys.version guards as then we'll remember to remove them when the guard is no longer needed.

@Pierre-Sassoulas Pierre-Sassoulas force-pushed the deserialize-from-json-reporter branch from 593a5ca to d967926 Compare June 29, 2022 07:27
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the deserialize-from-json-reporter branch from 75576dc to 0464370 Compare June 29, 2022 07:29
@github-actions
Copy link
Contributor

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit 0464370

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining pylint or the dev workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants