-
Notifications
You must be signed in to change notification settings - Fork 509
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
DiagnosticResult builder simplification #526
Conversation
…he format plus arguments
…imple message formats (no arguments)
…essage formats with arguments
…ported diagnostics
get | ||
{ | ||
if (this.message != null) | ||
return this.message; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will trigger SA1503. There are several more instances below that do the same.
I quite like this syntax, but I'm not too happy with having to create an array each time.
The VerifyCSharpDiagnosticAsync method must then be modified to no longer include the expected diagnostics as parameter. |
I agree with @vweijsters. |
@vweijsters @pdelvo What about an overload of |
That would ok with me. To make things even easier, I think that |
@vweijsters @pdelvo How would you like to proceed regarding this and #518?
I'm pretty heavily opposed to this, but as with anything else I'm will to discuss it separately. |
If xunit supports CancellationTokens we could use them. But we probably want a code fix/analyzer that would add that because it would take quite some time changing over a thausand unit tests. |
@pdelvo Handling of |
Im fine with using your solution with an overload added to VerifyCSharpDiagnosticAsync which accepts DiagnosticResult. |
I prefer the syntax in this pull request, so I would be in favor for using this instead of #518. |
…le DiagnosticResult instead of an array
@pdelvo @vweijsters Thank you for your prompt feedback. I have updated the pull request to include the new overload, followed by a commit to use that overload instead of the array where applicable (only changed the instances which were already converted to the new builder form) |
@pdelvo @vweijsters I'm planning to merge this as soon as the automated build passes. I'll update the remaining tests (spacing + SA1400) as a separate pull request. |
DiagnosticResult builder simplification
This pull request contains an alternative to the approach in #518. I'd specifically like to compare the solutions in their ability to meet the varying needs of the following diagnostics before moving forward with one or the other:
NumberSignSpacingTestBase
(used by SA1021 and SA1022 tests), which has argumentsThis pull request includes implementations of each of the above for review (they are provided as separate commits to make things a bit easier).