[DiagnosticVerifier] Verify all diagnostics by default #84685
Merged
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.
This adds the -verify-ignore-unrelated flag. When -verify is used without -verify-ignore-unrelated, diagnostics emitted in buffers other than the main file and those passed with -verify-additional-file (except diagnostics emitted at
<unknown>:0
) will now result in an error. They were previously ignored. The old behaviour is still available as opt-in using -verify-ignore-unrelated, but by being strict by default it should make it harder to accidentally miss diagnostics.To avoid unnecessary performance overhead, -verify-additional-file is still required to parse the
expected-*
directives in files other than the main file.Out of 4395 files using -verify, 404 required reverting to the old behaviour. I have not analysed the failures to decide whether adding
expected-*
directives would be more suitable for each test. I simplysed
ed each file that failed with the new behaviour to restore the old one. But since they were already using the old behaviour there's at least no regression in test coverage.The bulk changes to the tests are in a separate commit. I recommend reviewing each commit separately.