-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Migrate remaining failure messages to mypy.messages #6116
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
Comments
I like this idea. Moreover, I like the idea of having more systematic way of working with error messages, like error codes, see #2417. For example, TypeScript implemented such systematics long ago. @JukkaL had some concern about adding the error codes, but just migrating the errors messages to the same file could be a nice first step that will simplify further discussion. Also I think it makes sense to systematize only errors/warnings, notes can be kept ad-hoc. |
Great! I made a PR.
I made some comments in that issue.
Agreed. |
…ker) (#6118) Consolidate all mypy error messages into one place (`mypy.messages`). This opens the door to some interesting features, such as adding language localization or a more systematic way of working with error messages, akin to error codes (#2417). It also helps create more consistent messages. e.g. it's now more apparent that there are a few outliers that use single quotes around type names. I'm breaking this up change up into several PRs by module, this is the first and simplest. Once all are complete, this will address #6116.
….py) Consolidate .fail() messages into one place (`mypy.message_registry`). This will address python#6116.
Hello! I made this commit 14f1b5c to contribute to the issue. This is my first attempt at contributing on GitHub. Could someone provide me with some feedback on my solution? |
@SaintLeonar you need to open a pull request. Btw I am not sure mypyc errors are the most important to migrate. |
Migrate remaining failure messages to mypy.messages_registry (semanal_newtype.py). This will address python#6116
I'm working on a tool to provide a more gradual mypy adoption path, by providing a fine grained configuration for selecting or ignoring mypy errors. My current prototype uses regular expressions, but maintaining a comprehensive set of regular expressions is both time consuming and brittle, as existing messages could change, and new ones will be added.
I noticed that an effort has already been made to move error messages from
mypy.checkexpr
intomypy.messages
. Making this set of constants complete would solve my problem, and hopefully be of benefit to you all as well. Would you accept a pull request to migrate the remaining failure messages fromcheckexpr
,semanal
,semanal_newtype
, andfastparse2
tomessages
constants?The text was updated successfully, but these errors were encountered: