-
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
Added codefix for SA1404 #1251
Added codefix for SA1404 #1251
Conversation
/// <summary> | ||
/// The placeholder to insert as part of the code fix. | ||
/// </summary> | ||
public const string JustificationPlaceholder = "Code reviewed, suppressed."; |
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.
💭 I would argue that this is not actually a justification.
❓ Do we really want to do anything more than handle the case where no justification is provided, and insert an empty string? I lean towards keeping the code fix for adding |
I think Microsoft does the same thing in FxCop, it also adds a standard justification but that one is different from this one. Maybe use that one instead? |
Fixed issue #1253 |
@@ -126,6 +126,12 @@ | |||
<data name="SA1402CodeFix" xml:space="preserve"> | |||
<value>Move type to new file</value> | |||
</data> | |||
<data name="SA1404CodeFixAdd" xml:space="preserve"> | |||
<value>Add justification</value> |
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.
💡 I would just use one message (this message, and name it SA1404CodeFix
)
CodeAction.Create( | ||
MaintainabilityResources.SA1404CodeFix, | ||
token => AddJustificationToAttributeAsync(context.Document, root, attribute), | ||
nameof(SA1400CodeFixProvider) + "-Add"), diagnostic); |
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.
💡 SA1404CodeFixProvider
(this one says SA1400)
PR for #1110