views:

806

answers:

2
+3  Q: 

FxCop Suppression

I have a control on an Asp.Net page, on that page is a control with the name "PaReq" that violates the rule:

CA1704:IdentifiersShouldBeSpelledCorrectly

I've used suppression before I'm not sure how to suppress this error since it is defined in the generated file.

I could do this in a custom dictionary but that would mean all the developers would need to keep sync a copy of this dictionary which is something I'd rather avoid if possible. Also that the term "PaReq" is only used in this project.

How and where would I apply the suppression?

+4  A: 

I keep a custom dictionary per project which contains specific words for that project. That dictionary file is in my SourceControl repository, so other developers can use it (and add new words) as well.

Frederik Gheysels
Yes that's what we have now, but I had trouble with adding this word in - FxCop seemed to ignore it. Until I remembered the casing and added "Req" in to the custom dictionary - worked like a charm.
TWith2Sugars
+1  A: 

AFAIK you can add a suppression at the Assembly level although I've not used it in anger! You'd end up with some false negatives if you do that. (i.e. suppress all of the incidents that break this rule).

[SuppressMessage("Microsoft.Design", "CA1704",Scope="Assembly")]

I think the custom dictionary in source control is the best option, alternatively you could keep the FxCop project in source control.

Martin Clarke