-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[primer] Refactor the primer to use 'pylint.message.Message' #7000
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
[primer] Refactor the primer to use 'pylint.message.Message' #7000
Conversation
e252f7d
to
6e42f45
Compare
Pull Request Test Coverage Report for Build 2581919387
💛 - Coveralls |
6e42f45
to
fce0e86
Compare
@DanielNoord before I really investigate this, do you have any idea why the installation fail for this change ? (https://github.com/PyCQA/pylint/runs/7038428338?check_suite_focus=true) It seems strange that it fail at the install stage, but it's fairly consistent across runs. |
I don't think it fails at the install stage. Note that that is also the run stage. Have you tried this locally? |
fce0e86
to
bc9cb35
Compare
🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉 This comment was generated for commit bc9cb35 |
bc9cb35
to
4a3d2bf
Compare
🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉 This comment was generated for commit 4a3d2bf |
if GITHUB_CRASH_TEMPLATE_LOCATION in msg["message"]: | ||
msg["message"] = msg["message"].rsplit(CRASH_TEMPLATE_INTRO)[0] | ||
if msg["symbol"] == "astroid-error": | ||
if msg.category == "fatal": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is category the same as type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
json.dump(packages, f) | ||
json.dump( | ||
{ | ||
p: [JSONReporter.serialize(m) for m in msgs] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this serialisation even necessary? Aren't TypedDict
dumpable and loadable by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a typed dict at this point, it's an actual pylint.message.Message
instance because when we load the json we deserialize.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but we can't we remove both of those? And just store the TypedDict
in the json
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use the TypedDict we introduced in #7077 yes, but Message
is used everywhere in the code base.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And there an immutable location
in it that I'd like to use later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I missed the JSONReporter
serialises all of its messages before printing anyway. That makes this necessary.
Type of Changes
Description
Refs #6984, blocked by #7077