You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If mypy daemon generates errors in multiple files, successive daemon runs can change the order of messages even if they are otherwise identical (e.g. the first run produces messages from mod1 first followed by messages from mod2, and the second runs produces errors from mod2 first and mod1 next). Try to keep the order of error messages consistent across runs, since the varying order can be distracting when you are trying to fix errors one by one.
Suggested approach:
Store the order of files where we reported errors after each daemon run as a list
If we had errors in the previous run, sort the errors in the next run so that the order of files matches the previous run (and errors in additional files are at the end, for example)
Errors are already sorted consistently within a single file, but not across multiple files.
Another way would be to sort the messages by the file before reporting them, but this would be a bigger change conceptually and might have some issues (e.g. can't stream errors during the initial run). Preserving the order of errors from the immediate previous run shouldn't cause any additional issues. Related issue: #2144
Test cases to cover:
Initial, non-daemon run generates errors.
Two successive incremental runs generate errors.
There is a successful run between runs that generate errors. In this case the errors can be reported in an arbitrary order.
The text was updated successfully, but these errors were encountered:
I'm working on this right now, but i'm wondering what the best way to store state in-between function calls is, since the client is composed by functions and not by a class. how should i deal with this? Should i just store the file list in args? I also tried changing do_run into a callable class, but the tests didn't like it @JukkaL
This fixes an annoyance where the messages got reshuffled between
daemon runs.
Also if there are messages from files that didn't generate messages
during the previous run, move them towards the end to make them
more visible.
Fix#13141.
This fixes an annoyance where the messages got reshuffled between daemon
runs.
Also if there are messages from files that didn't generate messages
during the previous run, move them towards the end to make them more
visible.
The implementation is a bit messy since we only have a list of formatted
lines where it's most natural to sort the messages, but individual
messages can be split across multiple lines.
Fix#13141.
If mypy daemon generates errors in multiple files, successive daemon runs can change the order of messages even if they are otherwise identical (e.g. the first run produces messages from
mod1
first followed by messages frommod2
, and the second runs produces errors frommod2
first andmod1
next). Try to keep the order of error messages consistent across runs, since the varying order can be distracting when you are trying to fix errors one by one.Suggested approach:
Errors are already sorted consistently within a single file, but not across multiple files.
Another way would be to sort the messages by the file before reporting them, but this would be a bigger change conceptually and might have some issues (e.g. can't stream errors during the initial run). Preserving the order of errors from the immediate previous run shouldn't cause any additional issues. Related issue: #2144
Test cases to cover:
The text was updated successfully, but these errors were encountered: