Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you get FxCop rule CA1726 to ignore a preferred term?

FxCop has a rule (CA1726) that checks for preferred terms. This looks for words like "Dont" and tells you to replace them with better words like "Do not". Generally this is fine, however one of the terms it objects to is "Flag". At our firm, the business deals with Flags meaning those cloth things at the end of flagpoles. Suppressing this rule each time is becoming a pain. Does anyone know a way to get this rule to work on everything except "Flag"?

Note: I know I can turn the rule off completly, but I don't want to do that. I just want to turn off part of the rule.

like image 550
Martin Brown Avatar asked Feb 11 '09 11:02

Martin Brown


1 Answers

I have answered my own question.

It turns out that the list of preferred terms is listed in the CustomDictionary.xml file that is in the FxCop install directory (C:\Program Files\Microsoft FxCop 1.36\CustomDictionary.xml). There is a section <Dictionary><Words><Deprecated> that contains a number of <Term> elements. Simply removing the ones I don't want has done the trick.

like image 129
Martin Brown Avatar answered Sep 20 '22 21:09

Martin Brown