Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to suppress StyleCop Warning SA1649

Tags:

c#

stylecop

I am trying to suppress two occurences of the SA1649 error in StyleCop.

According to the documentation the suppression attribute looks like the attribute below

[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:FileHeaderFileNameDocumentationMustMatchTypeName", Justification = "Reviewed.")]

However, I cannot figure out what element I should apply the attribute to. If I put the attribute on the first element of the file (the IClassFactory Interface), I get the following error:

SA1649 : CSharp.Documentation : The file attribute in the file header's copyright tag must contain the name of the first type in the file and can be any of these: "IClassFactory" C:(...)COMHelper.cs

Can that error be suppressed? What element should it be applied to?

like image 636
Vincent Hubert Avatar asked Apr 11 '14 18:04

Vincent Hubert


1 Answers

Use a namespace level suppression:

[module: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:FileHeaderFileNameDocumentationMustMatchTypeName", Justification = "Reviewed.")]

namespace MyNamespace
{

}
like image 185
Chris Avatar answered Sep 23 '22 08:09

Chris