-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Errors are not sorted by file #2144
Comments
(It's important not to attempt to sort the textual output, because it may contains note referring to other files in the import stack that led to a specific error.) |
+1 on the command line order. In general the output for |
Yep, it makes updates of mypy reports hard to read: https://gist.github.com/sebastian-philipp/25f70aae3b0d21b1a781c110a7ef8be4/revisions |
Mypy now does error streaming, i.e. errors are reported as soon as they are generated. Sorting errors is incompatible with streaming. |
yep, it would need to store the errors and print everything at the end after the last file finishes. |
Well, it does still store them and print them later. They are printed after a file or a group of interconnected files (through import cycles) is processed. So they could be sorted within such a file (group). Also, in daemon mode all errors come out at the very end (though we occasionally regret this) so it should be possible to sort them all. |
Workaround for python/mypy#2144 Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Workaround for python/mypy#2144 Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Workaround for python/mypy#2144 Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Workaround for python/mypy#2144 Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
I just noticed that when you run mypy on a large number of files, the errors don't come out sorted by filename, even if you pass the filenames in sorted order on the command line. I presume this is some kind of side effect of processing files in an order determined by the dependency graph.
Maybe we should just sort them all by filename? Or sort them back in the order in which they were passed on the command line (or expanded from packages/directories)?
It seems the Errors.sort_messages() method in mypy/errors.py could easily sort messages by filename; sorting them by original order would require the original order to be passed in to that function (not rocket science, but perhaps requiring some small refactoring).
The text was updated successfully, but these errors were encountered: