-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Refactor of MessageStore for multiple old message #2262
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
Refactor of MessageStore for multiple old message #2262
Conversation
a413f99 to
f5b17ac
Compare
|
Sorry this is super messy but starting by really changing MessageStore was not a reasonable way to do it (way too complex). So I just changed line 888 in python/utils.py in order to return a list and now I'm trying to pass existing tests. I'm afraid there will be a lot of changes to do. For exemple somewhere we use get_message_definition to return a symbol. But we now need to return a list of symbol, so the refactor will spread elsewhere... Also for some strange reason I can't test in my setup, I get "AttributeError: 'Assign' object has no attribute 'type_annotation'" everywhere. |
|
@PCManticore this is not ready for review yet, I'm using the travis to circumvent my local bug with the tests :) |
ddc2d02 to
b457fd0
Compare
|
@PCManticore, I have the following error locally but the same code does not have the problem on the Pylint Travis... It prevent me from using pbd to debug. Pushing to Travis everytime is not very efficient. Any idea of the reason I get that ? I saw this post, is it a known current problem with cygwin/mingw ? |
|
@Pierre-Sassoulas You need the latest astroid for getting read of that error, I'd suggest rebuilding the tox environment with |
|
@Pierre-Sassoulas Going to review this once the dust settles for the 2.0 release, so most likely next week. Sorry for the delay! |
PCManticore
left a comment
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.
This looks 💯 @Pierre-Sassoulas ! Seems the CI is failing but once it's green, we can ship it. I'll take a look at your missing-docstring PR this weekend.
c47d6e0 to
d9f2c87
Compare
1 similar comment
|
Hi @PCManticore. Thanks to the national holidays the tests for this are now passing... I modified some tests, and I'm surprised there is so little changes. If I were you I would check with care what was changed before merging. At least what was changed in the tests. This is a first step towards being able to have multiple values for a message in MessageStore. Before we returned a message Definition. In this PR we always have a list of only one value, next step will be to actually change the MessageStore to have a list of multiple MessageDefinition for an old name. As I said this a big refactor and it's easier done with small incremental steps. Slightly related my astroid was deprecated again. It's hard to see, especially when you're working on something that is supposed to break the tests. It took me some time to think of testing that the master branch tests were still passing. Maybe you should add the "tox --recreate" advice in the doc ? Good job on adding black and a pre-commit hook ! Regards, |
|
Hey @Pierre-Sassoulas Great stuff, thank you coming back at this! I'll do a final review and merge this weekend so that could unblock you for your other PR. |
d9f2c87 to
c7e8b46
Compare
b7a8b57 to
f0e8a77
Compare
|
@Pierre-Sassoulas There's something wrong with this PR, it has quite a lot of changes. :) I'd like to merge it this week, so if you have some time to revert the inadvertent changes, that would be amazing. |
Of MessageDefinition instead of a MessageDefinition.
We return a list of message definitions so we must rename get_message_definition to get_message_definitions. Resulting variables are now named message_definitions most of the time in order to improve readability. (It was often named "msgs" or worst "symbol")
When refactoring MsgStore we don't want the test to break if two conflicting symbol or msgid are inverted. So we sort them, in order for the error message to stay stable.
f0e8a77 to
ef2bd70
Compare
|
@PCManticore sorry, I pushed by mistakes the change I did for the next step, should be ok now. |
db69e32 to
ef2bd70
Compare
|
@Pierre-Sassoulas Thank you for waiting! This is merged now, let me know if you need anything for #2036 |
|
@PCManticore thank you for merging this first step. As you said earlier there is a lot of change in my current branch. Should I try to make multiple PR or should I put everything in #2036 ? There is a break up of utils.py into a package for example, and a renaming of 'MessageDefinition' to 'Message'. |
|
@Pierre-Sassoulas Separate PRs could be better, since we can merge those faster than a big chunk. |
|
Sorry for the delay, I had a hard time separating the changes. Here's the first one, the refactor of utils.py : #2654 |
Also fixed spelling in C0112 to C0116 messages following the review of pull-request pylint-dev#2036 by Ashley Whetter. See also pylint-dev#2075, pylint-dev#2077, pylint-dev#2262, pylint-dev#2654, pylint-dev#2805, pylint-dev#2809, pylint-dev#2844, pylint-dev#2992 and pylint-dev#3013 for full historical context.
Also fixed spelling in C0112 to C0116 messages following the review of pull-request pylint-dev#2036 by Ashley Whetter. See also pylint-dev#2075, pylint-dev#2077, pylint-dev#2262, pylint-dev#2654, pylint-dev#2805, pylint-dev#2809, pylint-dev#2844, pylint-dev#2992 and pylint-dev#3013 for full historical context.
Also fixed spelling in C0112 to C0116 messages following the review of pull-request pylint-dev#2036 by Ashley Whetter. See also pylint-dev#2075, pylint-dev#2077, pylint-dev#2262, pylint-dev#2654, pylint-dev#2805, pylint-dev#2809, pylint-dev#2844, pylint-dev#2992 and pylint-dev#3013 for full historical context.
Also fixed spelling in C0112 to C0116 messages following the review of pull-request pylint-dev#2036 by Ashley Whetter. See also pylint-dev#2075, pylint-dev#2077, pylint-dev#2262, pylint-dev#2654, pylint-dev#2805, pylint-dev#2809, pylint-dev#2844, pylint-dev#2992 and pylint-dev#3013 for full historical context.
Work in progress of the refactor for #2036
In order to see what still need to be done.