-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add flag to tag known messages with an error code (take 2) #6472
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
Thanks for continuing to work on this! Sorry for a long delay, we are now in process of a big refactoring, so we don't have much time for reviews. One of us (most likely @JukkaL since he reviewed previous related PR) will review this as soon as we are more or less done with the refactoring. |
No worries.
Is there an issue or PR where I ca read about the goals of the refactor?
Sounds exciting ;)
…On Mon, Mar 4, 2019 at 2:55 AM Ivan Levkivskyi ***@***.***> wrote:
Thanks for continuing to work on this! Sorry for a long delay, we are now
in process of a big refactoring, so we don't have much time for reviews.
One of us (most likely @JukkaL <https://github.com/JukkaL> since he
reviewed previous related PR) will review this as soon as we are more or
less done with the refactoring.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6472 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAD3ExB_e__Ih5y6UG6s0LgP1IQ0yoATks5vTPu2gaJpZM4bOOHv>
.
|
It looks like there is no main issue, but we have this label to track progress https://github.com/python/mypy/labels/new-semantic-analyzer. |
I have time to work on feedback now, if you all can find the time for a review! |
I’m happy to resolve the conflicts when you all are ready to review. Just
let me know.
…On Wed, May 8, 2019 at 9:37 AM Ivan Levkivskyi ***@***.***> wrote:
@JukkaL <https://github.com/JukkaL> Will you have time to review this PR?
It looks pretty important.
@chadrik <https://github.com/chadrik> There are few merge conflicts now.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6472 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAPOEZ6LFBHP5SELR3IAGLPUL6UXANCNFSM4GZY4HXQ>
.
|
IIUC this is superseded by #7334 (now merged). Thank you for your efforts! |
Hi all,
I'm back with a new PR to replace #6152. I've tried to get satisfactory answers to the great questions that @JukkaL and @ilevkivskyi posed in the last PR, which I've reposted below with answers:
This has been partially addressed by #6194, by moving many message constants to
mypy.message_registry
, however, we have a lot more to move.Also in
mypy.message_registry
. String format args must be passed tofail()
methods rather than formatting first, in order to preserve the message constant until it reachesMessageBuilder
, so that an id can be looked up from the string literal. I haven't made that change throughout the code yet since it will be a lot of repetitive work and I wanted to get some feedback on the design of this PR first. That means in its current form, registered messages that are pre-formatted before being passed tofail()
are still being marked as 'uncategorized_error' in mypy output.For output examples, you can see some examples in
check-error-codes.txt
.Silencing error messages via a config file has been discussed here and here. This PR sets up all of the data necessary to implement filtering and the semantics of configuration and filtering messages can be solved in a separate PR.
I'm assuming this is about listing message ids. This is not in the tests yet, but here's an example of what it looks like:
This is a great question. My current thinking is that message grouping can be added using a separate dictionary at a later point.
I've simplified my approach from the original PR, so I think we should be in the clear, but I have not run any tests against mypyc yet.
I provided an example for
attrs
, and if we like it I can propagate it to the other builtin plugins.That said, since I'm using the plugin module as a unique namespace to prefix the error codes, this PR would benefit from the default plugin being broken up into a series of plugins:
mypy.plugins.attrs
,mypy.plugins.ctypes
, andmypy.plugins.dataclasses
.In addition to improving error labels for this PR, breaking up the default plugin has some other advantages:
attrs
here)If you agree, I'm happy to do that in a separate PR.
Covered above: the name of the plugin module is used. For the core error codes I use the namespace 'mypy'.
I decided to provide a default namespace for 3 reasons:
--list-error-codes
:
in mypy output with--show-error-codes
makes for easier parsing by 3rd party scriptsmypy.parse
mypy.analysis
,mypy.check
, etc.TBD