Skip to content

Provide an extensibility point in AnalyzerTest for sorting diagnostics.#1003

Merged
mavasani merged 2 commits into
dotnet:mainfrom
jkoritzinsky:extensible-analyzer-sorting
Aug 3, 2022
Merged

Provide an extensibility point in AnalyzerTest for sorting diagnostics.#1003
mavasani merged 2 commits into
dotnet:mainfrom
jkoritzinsky:extensible-analyzer-sorting

Conversation

@jkoritzinsky

Copy link
Copy Markdown
Member

The sort here is non-deterministic for any analyzers whose diagnostics can differ only on the message format and properties.

Allow the sorting algorithm to be changed by the user to include either or both of these elements if they emit diagnostics that differ only on these values from a concurrent analyzer (the .NET Interop team owns an analyzer like this, which prompted this work). This will ensure that everyone can ensure that their diagnostic and code-fix tests (which rely on the ordering to determine the order for the iterative code-fix tests and the fix-all tests) are deterministic.

cc: @sharwell

The sort here is non-deterministic for any analyzers whose diagnostics can differ only on the message format and properties.

Allow the sorting algorithm to be changed by the user to include either or both of these elements if they emit diagnostics that differ only on these values from a concurrent analyzer (the .NET Interop team owns an analyzer like this, which prompted this work). This will ensure that everyone can ensure that their diagnostic and code-fix tests (which rely on the ordering to determine the order for the iterative code-fix tests and the fix-all tests) are deterministic.
@mavasani
mavasani enabled auto-merge August 3, 2022 16:55
@mavasani
mavasani merged commit 7d6d807 into dotnet:main Aug 3, 2022
@jkoritzinsky
jkoritzinsky deleted the extensible-analyzer-sorting branch August 3, 2022 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants