Skip to content
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

Merged
merged 4 commits into from
Aug 20, 2015
Merged

Conversation

hvanbakel
Copy link
Contributor

PR for #1110

/// <summary>
/// The placeholder to insert as part of the code fix.
/// </summary>
public const string JustificationPlaceholder = "Code reviewed, suppressed.";
Copy link
Member

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.

@sharwell
Copy link
Member

❓ 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 Justification = "", but removing the part of the code fix that inserts a non-empty string.

@hvanbakel
Copy link
Contributor Author

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?

@hvanbakel
Copy link
Contributor Author

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>
Copy link
Member

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);
Copy link
Member

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)

@sharwell sharwell self-assigned this Aug 20, 2015
@sharwell sharwell added this to the 1.0.0 Beta 9 milestone Aug 20, 2015
@sharwell sharwell merged commit 5d42b2b into DotNetAnalyzers:master Aug 20, 2015
@hvanbakel hvanbakel deleted the Codefix-SA1404 branch August 20, 2015 15:32
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