Passing error_formatter in new_messages method of Error Class #18801
+8
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #18713
Problem -
When user runs dmypy for a file once (with flag output=json) , it gave correct validation error (in form of json)
But when user changes something in file and then runs the same command again , it does give error in json format because
since the daemon is running now , the code flow goes to print out errors without error_formatter set
Solution -
I passed formatter to new_messages of Errors Class (with default value None), so that when FineGrainedBuildManager is called again , it will have BuildManager associated with it and which will have the error_formatter set (if it was set intially while running daemon).